[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

How to shorten classpath?

Posted on 2008-01-31
10
Medium Priority
?
698 Views
Last Modified: 2012-08-13
Dear Experts,

My app requires more and more jars in it's classpath.  Is there a way to either:

1.  Put all the jars in one jar?

or

2.  Use relative instead of absolute paths?

If neither, how do you folks handle it?

Thanks!
BrianMc1958
0
Comment
Question by:BrianMc1958
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 400 total points
ID: 20786765
0
 
LVL 3

Assisted Solution

by:_ee
_ee earned 200 total points
ID: 20786796
You could edit the classpath inside your environment to always include certain jars.  On linux the file is /etc/environment.  If this is the classpath you're talking about, then if there is a way to shorten it, I don't know how =).
0
 
LVL 23

Accepted Solution

by:
cmalakar earned 1200 total points
ID: 20786849
In jdk 1.6, you can use "*" in a classpath to denote all the jar files inside a directory..

java.exe -classpath C:\dir\*
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 23

Expert Comment

by:cmalakar
ID: 20786881
0
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 400 total points
ID: 20786913
>>Use relative instead of absolute paths?

Yes!
0
 
LVL 9

Assisted Solution

by:ysnky
ysnky earned 200 total points
ID: 20786989
to merge jar files, uncompress the JAR files and then compress again.
0
 

Author Comment

by:BrianMc1958
ID: 20787041
To cmalakar:

Your solution looks like what I've been looking for for years.  I don't use the JDK, though.  Just the JRE.  Does your solution work just with JRE6?
0
 
LVL 23

Expert Comment

by:cmalakar
ID: 20787352
It is supported only in jdk 1.6

You can check out the explanation of classpath option here..

1.6 :-- http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html

1.5:-- http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html
0
 
LVL 23

Expert Comment

by:cmalakar
ID: 20787629
>> It is supported only in jdk 1.6

I mean java 1.6, (both jdk1.6 and jre 1.6)
0
 

Author Comment

by:BrianMc1958
ID: 20788367
Great.  Thanks a lot.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

590 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