Link to home
Start Free TrialLog in
Avatar of vbguy
vbguy

asked on

problem with classpath being too long with java

Hi,

I have to add a ton of jars to compile my java and
I am hitting the w2k limitaiton on variables.

Can some suggest a way to get all of my jars in my classpath
without running into the w2k limitation?

thanks,
arthur
Avatar of 91mustang
91mustang

Just add them to this directory, and do not need to modidy classpath directory:

\j2re1.4.2_04\lib\ext
replace j2re1.4.2_04 with the location of you sdk:

Mine is: C:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\lib\ext
In general, when you specify a directory in the CLASSPATH then everything below is found.
So, if you put all jar's in ONE tree, you only have to specify the tree-top directory once.
;JOOP!
ASKER CERTIFIED SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Another alternative is to extract the files you need from the original jars and repack them into your own jar for deployment. I have used this method on a large telco project and most IDE's provide a facility to make this quick and painless.

Bewarned though that if you are using a common code base or a shared web server you could encounter problems with Class/Library version conflicts, but as long as all involved are ware of the situation it can be managed easily.

Hope this helps mate.
Avatar of vbguy

ASKER

Hi,

I put all my jars in the following directory:

C:\java\jdk1.3.1_07\jre\lib\ext

Still getting issues with finding classes, do I have to do anything extra
for the jdk to read those jar files?

Thanks,
Arthur
Is that the only jdk on your machine, i suspect you may have another
Could be.
I agree, sounds like there is more that one JDK/JRE on your machine mate. Try doing a seach on your hard drive for all directories with the name "ext". This should give you an idea of the JDK/JRE's that you have.

Hope this helps mate.
Split: 91mustang, mayankeagle
So what was the solution was on this problem vbguy? the answer you selected does not say much that my answer above does not say, I am just curious to know?
vbguy, please clarify. I'd suggested a split.