• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

jar classpath help

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 80742
485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heh. Yeah, that Google engine works quickly.
 
reply
    Bookmark Topic Watch Topic
  • New Topic