Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java "Installed Extensions" directory not working, why?

407566Jan 10 2011 — edited Jan 11 2011
Hi, thank you for reading this post!

According to the Java Trail "The Extension Mechanism", the installed extensions directory is "lib/ext" under JDK or JRE. And all you have to do is place third party JAR files in that directory, import the correct package and your program will compile and run.

It doesn't appear to be so.

I checked the ext directory with this command:
String extDirs = System.getProperty("java.ext.dirs");
It returns

C:\Program Files\Java\jre6\lib\ext; C:\Windows\Sun\Java\lib\ext

as the two directory. I placed third party JAR file in the "C:\Program Files\Java\jre6\lib\ext", as well as the "C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext" directories. I proceed to compile and run my program. According to the Java Trail, this should work, but it didn't. It gave me an "ClassNotFoundException". So I had to resort to setting the CLASSPATH environment variable.

What is wrong? What else needs to be done for your program to access the JAR class files in the lib/ext under JRE or JDK?

Thanks in advance!

Eric
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2011
Added on Jan 10 2011
4 comments
642 views