?
Solved

problem with classpath being too long with java

Posted on 2004-04-30
13
Medium Priority
?
258 Views
Last Modified: 2013-11-23
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
0
Comment
Question by:vbguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
13 Comments
 
LVL 4

Expert Comment

by:91mustang
ID: 10964101
Just add them to this directory, and do not need to modidy classpath directory:

\j2re1.4.2_04\lib\ext
0
 
LVL 4

Expert Comment

by:91mustang
ID: 10964116
replace j2re1.4.2_04 with the location of you sdk:

Mine is: C:\Program Files\j2sdk_nb\j2sdk1.4.2\jre\lib\ext
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 10966870
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!
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 30

Accepted Solution

by:
Mayank S earned 150 total points
ID: 10971293
Sciuriware, putting the directory-name is not enough if the directory contains JARs. What you're suggesting is all right if the class-files were directly under the directory, but since they are JARed, each individual JAR must be in the classpath.

The better way is, of course, to put it under lib/ext.

In case you are working with JSPs/ Servlets using Tomcat, then put them under common/lib or put them under the WEB-INF/lib folder of your project.
0
 

Expert Comment

by:joshuasherlock
ID: 11012035
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.
0
 

Author Comment

by:vbguy
ID: 11014518
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
0
 
LVL 4

Expert Comment

by:91mustang
ID: 11016021
Is that the only jdk on your machine, i suspect you may have another
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11020733
Could be.
0
 

Expert Comment

by:joshuasherlock
ID: 11027192
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.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11683275
Split: 91mustang, mayankeagle
0
 
LVL 4

Expert Comment

by:91mustang
ID: 11684343
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?
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11687449
vbguy, please clarify. I'd suggested a split.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month11 days, 7 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question