> Hi!
>
[quoted text clipped - 6 lines]
>
> Regards
Please do not multipost.
That's the whole purpose of the classpath. Otherwise how does Java know
where to find the classes it's looking for?
VisionSet - 31 May 2004 00:15 GMT
> > Hi!
> >
[quoted text clipped - 4 lines]
> > that depends on other JARs without having to alter the classpath
> > variable to add all the external libraries that an app uses ?
> Otherwise how does Java know where to find the classes it's looking for?
It looks in the jre/lib/ext directory.
Put your JARs there. This maybe a little trickier if you are deploying this
over many clients, and then again maybe not.

Signature
Mike W
Roedy Green - 31 May 2004 01:02 GMT
>Is there a way to run a Java app
>> that depends on other JARs without having to alter the classpath
>> variable to add all the external libraries that an app uses ?
yes, you can specify the jars or the classpath on the command line.
you can also put jars in the ext directory.
See http://mindprod.com/jgloss/classpath.html

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
> I'm developing a Java app using the Eclipse IDE. My app uses some
> external JARs to work. The app runs fine from the IDE, I suppose Eclipse
> takes care of all the dependencies. But, when I try to run it from the
> command line, it cannot find the JARs. Is there a way to run a Java app
> that depends on other JARs without having to alter the classpath
> variable to add all the external libraries that an app uses ?
When you put your classes in a JAR file, that JAR file has a manifest. You
can use the default manifest, and add two headers to it to create a
"self-contained" application:
Main-Class: package.to.MainClass
Class-Path: library1.jar library2.jar
The Class-Path header contains relative URL's to the JAR files. IN the
example above, it looks for the JAR files it depends on in the current
directory.
As pointed out by others, you can also place the JAR files you depend upon
in the lib/ext subdirectory of the directory the JRE resides in.
Personally, I prefer the first approach however; it's easier to uninstall
(as no other application will use your files).
Oscar

Signature
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website
PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2