1

Possible Duplicate:
Can I use the classpath to override a file in a jar that is being run?

I have an application that is packed into a runnable jar file, this application use several external jar libraries including them into the classpath. The list of libraries is specified into the manifest.mf file of the main executable jar.

I want to let the user override the classpath contained into the manifest.mf by specifying a classpath from the command line(for example -cp), but I can' t make it work.

Though i pass the classpath with the option -cp, the classpath in the manifest file is not overridden , is there a way to override a classpath contained in the manifest file ? How?

Community
  • 1
  • 1
aleroot
  • 71,077
  • 30
  • 176
  • 213
  • What is the command used to execute the app? You don't ise both -cp and -jar, do you? – JB Nizet Jan 13 '12 at 00:14
  • 3
    dont use the jar option.. just use cp and provide your main class name .. I think using the jar option will make the jvm take only the classpath provided in the jar.. – sethu Jan 13 '12 at 07:22
  • Hi, did you find a solution? I have the same question. Using -cp without -jar worked for you? Is it add classpath entries to the one defined in the manifest? or, it overrides the manifest (so the manifest entries are not taken into account)? – manash Mar 07 '12 at 09:11
  • If you use -cp the MANIFEST.MF in the jar is not considered ... – aleroot Mar 07 '12 at 09:14

0 Answers0