Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Use of jre\lib\ext directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Use of jre\lib\ext directory" Watch "Use of jre\lib\ext directory" New topic
Author

Use of jre\lib\ext directory

Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

I read somewhere that I can dispense with a huge
CLASSPATH environment variable by plonking all my
required jar files in jre\lib\ext and the runtime will
automatically look for packages there.
I've done that but it doesn't seem to pick it up.
Can someone help me understand the relevance of
jre\lib\ext and how to make it work ? Thanks.
Pho


Regards,

Pho
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
This is a description of all of the directories: http://java.sun.com/products//jdk/1.2/docs/tooldocs/solaris/jdkfiles.html
Your CLASSPATH would need to include the /JRE/LIB/EXT directory to pick this up. It sounds like they were just suggesting blending your stuff with any extention jars that you are using.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Mark Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
Pho,
It's interesting that it doesn't work for you because it works for me - and I'm not adding jre/lib/ext to my classpath.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
OK Mark, Now you made me go out and learn something .
This is some reading on extension libraries: http://java.sun.com/j2se/1.3/docs/guide/extensions/spec.html
and it says that one of the properties of System is the java.ext.dirs property and that it defaults to < java-home>\lib\ext [Win32] or < java-home>/lib/ext [Solaris].
So I guess that you DO NOT need to put it in your classpath. However if you put extensions anywhere but the default, then you need to modify this property.
[This message has been edited by Cindy Glass (edited March 26, 2001).]
Mark Savory
Ranch Hand

Joined: Feb 08, 2001
Posts: 122
Rats! Now I learned something too.
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

I'm going to check whether my JAVA_HOME env var is set
correctly. And try again.
Thanks to all.
Pho
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Also bear in mind that it can be easy to get confused if you have more than one JRE or SDK installed. In particular, on Windows Systems there is usually a JRE in "Program Files" as well as one in wherever you installed your Java 2 SDk. Make sure that your jars are in the right one (or both if you are very cautious).


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Use of jre\lib\ext directory