AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loading classes using class loader and class path

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Efi Merdler
Guest





PostPosted: Fri Nov 17, 2006 8:27 pm    Post subject: Loading classes using class loader and class path Reply with quote



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





PostPosted: Fri Nov 17, 2006 8:48 pm    Post subject: Re: Loading classes using class loader and class path Reply with quote



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





PostPosted: Fri Nov 17, 2006 11:34 pm    Post subject: Re: Loading classes using class loader and class path Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.