Search code examples
javaeclipseclasspathjava-3d

javac can't find jar files that have been installed in jre/lib/ext


I want to try out the Java3D library and have used the installer to auto-install them for me (I'm running windows). I was using Elipse and noticed that it couldn't find the packages. I tried compiling a class outside of Eclipse from the command line and has the same issues there.

The installer has definitely put the jar files in my java-sdk/jre/lib/ext folder so I'm not sure why it isn't automatically detecting them as I thought that this folder was automatically searched.

I then manually added the jar to the classpath by setting the CLASSPATH environment variable and the program outside of Eclipse then worked. Eclipse still couldn't find them, so I added the jars to my Eclipse project and it works.

The thing I'd really like to know is why I had to set the CLASSPATH environment variable when the jars were installed in the jre/lib/ext folder.

Other information is that I notice that there's no JAVA_HOME variable in my environment variables. Should there be? This might be the problem.

Also, just for interest (and learning) I notice in the Java installation that there is a JRE folder inside the Java-SDK-1.6.xxx folder and also another one in the same directory as the Java-SDK-1.6.xxx folder. Why is this?

Many thank in advance.

Joe


Solution

  • Check this .

    http://www.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html