• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

setting classpath jar

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have a jar file which contains relavent libraries inside its lib folder.

for one jar file I have set the manifest file like this
Class-Path: log4j-1.2.13.jar
to keep multiple jar file in classpath what should i do
or any other idea like jar dependency while creating jar.
(dont know how to create this jar dependcy)

regards
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you can nest the jars. You can put them next to each other and let an executable jar point to the neighbouring jars using the classpath manifest entry.

So you "MUST" have an executable jar for this, otherwise it won't work.
Example manifest:

Manifest-Version: 1.0
Main-Class: com.test.Start
Class-Path: jar1.jar jar2.jar jar3.jar

So put all the jars in one directory and then execute the executable jar (containing the manifest).

PS. I use Ant to create my jars (integrated in eclipse).
Jar file specification
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks it worked
 
Bartender
Posts: 1973
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to do this from Eclipse. But it didn't work. I make a jar of all the lib files and "Added External Jars" to the project. But, when I removed the lib files, Eclipse couldn't find the relevant lib files.

Do I need to add a classpath variable that points to the .jar file specifically or make it executable like you mentioned above?

Thanks in advance.

Mike
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic