Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar classpath help

 
Ellen fish
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a d.jar containing

MANIFEST.MF
a.jar
b.jar
c.jar
main.class

My MANIFEST.MF is

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 11.0-b15 (Sun Microsystems Inc.)
Main-Class: RAPTestTool
Class-Path: a.jar b.jar c.jar

but when I call java -jar d.jar I'm still getting no class found. Did I not add these jar file in my classpath properly?

Any help will be greatly appreciated. Thank you

just an extra question how can I create a folder and move a.jar b.jar c.jar there?

Thank you thank you
 
Henry Wong
author
Marshal
Pie
Posts: 21122
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classpath variable (either environment or in the manifest) is used to find jar files in the local directories. The JVM doesn't search for jar files inside other jar files.

Henry
 
Ellen fish
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh I see..
Then is there any way to group all the jars and the class together to make it a single executable jar or something else?
Thank you soooooo much for your help

[ November 26, 2008: Message edited by: Ellen fish ]
[ November 26, 2008: Message edited by: Ellen fish ]
 
Brian Lang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ellen fish:
Then is there any way to group all the jars and the class together to make it a single executable jar or something else?


Search for 'java jar rejar' on Google. I personally think distributing your application jar in a directory with a simple 'lib' subdirectory (containing the linked jar files) is easier and neater, but it can be done.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Lang:
Search for 'java jar rejar' on Google.


I tried just that and got this as the first hit
 
Brian Lang
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heh. Yeah, that Google engine works quickly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic