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

How do I set the classpath to access JARS contained within a Jar File

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to build a single jar file containing two executables and the jar files they need to function (i.e., for MySQL access, to mail results, XML processing, log4j, etc). There is no default class and therefore each of the two executables are accessed by it's full package name with the CLASSPATH environment variable set to the name of the containing jar file, e.g.:



Inside the manifest, I am setting the Class-Path attribute to "lib/mail.jar lib/log4j-1.2.15.jar lib/xmlrpc-2.0.1.jar lib/xerces.jar lib/pcng-server-11.6.jar lib/commons-codec-1.3.jar lib/linfield.jar" which is their path within the jar file. The problem is that java isn't finding them. Am I doing something wrong or trying to do something that isn't supported in Java 6?

Thanks,
Rob Tanner
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob,
Java isn't designed to read nested jars. Any reason you can't unjar it and have the jars "loose"?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic