Importing jars

Is there any way to import classes that are in a jar file, without explicitly placing the target jar in the classpath?I want to create an executable jar file which will contain a main class that references classes in an external jar, without having to configure the operating
[297 byte] By [torfua] at [2007-11-27 4:48:31]
# 1

No. (At least, not without some fancy custom class loader that can find the classes in the jars some other way).

You can have the 2 jars in the same directory (usually) then in the executable jar's manifest file, you can define the classpath there, which can refer to the 2nd jar by relative paths. Just look up some info on manifest files, cuz I never can remember the gory details.

bsampieria at 2007-7-12 10:01:26 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks a lot!
torfua at 2007-7-12 10:01:26 > top of Java-index,Java Essentials,Java Programming...