I want to include class files in other directories, not the directory of the main class.
If I put these directories into the Class-Path
property of MANIFEST.MF
it doesn't work.
Why? Is there any solution except packing these classes into a jar File?
By using the Class-Path header in the manifest, you can avoid having to specify a long -classpath flag when invoking Java to run your application. Note: The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over Internet protocols.
The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes.
To check our CLASSPATH on Windows we can open a command prompt and type echo %CLASSPATH%. To check it on a Mac you need to open a terminal and type echo $CLASSPATH.
A trailing slash would be required as mentioned in this link:
Class-Path Attribute
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With