 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Efi Merdler Guest
|
Posted: Fri Nov 17, 2006 8:27 pm Post subject: Loading classes using class loader and class path |
|
|
Hi,
I'm trying to load classes using a class loader. Under eclipse
everything is working fine.
I've created a jar file (using FatJar) of my application, now when
trying to load my classes I receive an exception.The classes are
external,there are not part of the jar.
The classes I'm trying to load are located in the default package, i.e.
no package.I copied them to where the the jar is located.
At the beginning I used : java -jar myJar.jar
As you can guess it didn't work.
Next I used : java -cp "." -jar ...
I changed the default package to a concrete one.
I tried all kind of classpath possibilities while using
http://www.kevinboone.com/classpath.html for help.
Still does not work
What am I missing ?
Efi |
|
| Back to top |
|
 |
Andrew Thompson Guest
|
Posted: Fri Nov 17, 2006 8:48 pm Post subject: Re: Loading classes using class loader and class path |
|
|
Efi Merdler wrote:
....
| Quote: | At the beginning I used : java -jar myJar.jar
As you can guess it didn't work.
Next I used : java -cp "." -jar ...
|
AFAIU, as soon as -jar arg. used, the -cp
argument is ignored. The only way to inform
jar1 (with main()) of jar2's existence is by a
manifest in jar1 (or WebStart).
Alternately, you might try getting jar2 as
a File/URL argument in jar1, and using a
custom classloader..
Andrew T. |
|
| Back to top |
|
 |
Efi Merdler Guest
|
Posted: Fri Nov 17, 2006 11:34 pm Post subject: Re: Loading classes using class loader and class path |
|
|
| Quote: | AFAIU, as soon as -jar arg. used, the -cp
argument is ignored. The only way to inform
jar1 (with main()) of jar2's existence is by a
manifest in jar1 (or WebStart).
Alternately, you might try getting jar2 as
a File/URL argument in jar1, and using a
custom classloader..
Andrew T.
|
Thanks.
Following your replay I found an interesting link concerning this
problem, it might help others.
http://mindprod.com/jgloss/jar.html#CLASSPATH
Efi |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|