Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load a whole directory using Class-Path: jar manifest header? [duplicate]

If in the manifest for a jar file that needs to load non executable jars, I have the Class-Path: specification and then a directory holding the jars as the class path instead of a jar file. Will the manifest then load the whole directory or will it just fail?

Update: I tried to use Class-Path: foo/* however it failed to load the foo directory. Does the manifest classpath not support regex>

like image 406
jgr208 Avatar asked Nov 20 '25 22:11

jgr208


1 Answers

As long as your foo directory contains only .class files, you can safely set the Class-Path: header like this:

Class-Path: foo/

Since you have non executable jars in it, you should use a build tool like Maven to generate the Class-Path: entry for you. The non executable jars will be dependencies of your Maven project.

Reference:

  • JAR : MANIFEST.MF Class-Path referencing a directory
like image 117
Stephan Avatar answered Nov 23 '25 12:11

Stephan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!