GeeCON Prague 2014*
The moose likes Java in General and the fly likes Classpath inside Jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Classpath inside Jar" Watch "Classpath inside Jar" New topic
Author

Classpath inside Jar

Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Hey guys,

I'm putting some stuff in an executable Jar, and I'm wondering, do the classes/packages always need to be found at the top level?

For instance, if I have a package named org.foo.bar, does the org folder need to be at the top level, or can I put all my packages in a folder named bin, and set the classpath to this folder?

Thanks.
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

Since packages has been stuffed into the JAR file, only jar file name can be set in the classpath... And org folder should be at the top level, Then only JVM can make search into the jar and visits the folder correctly


SCJP 6 [SCJP - Old is Gold]
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  16

Thanks man. Bit of a pity.
 
GeeCON Prague 2014
 
subject: Classpath inside Jar