Tim Holloway wrote:
Thinking that you could just point to a directory full of JARs and have all the classes in all the JARs automatically available is one of the oldest newbie problems in the book.
J. Kevin Robbins wrote:You shouldn't need to specify the full jar file name in either the environment variable or the -cp option, only the directory or directories where the jars are located.
Think of it like the $PATH environment variable in Windows or *nix. You don't specify the name of each executable file, only the directories where the executables are located.
J. Kevin Robbins wrote:I generally recommend that people avoid using the $CLASSPATH environment variable. It just leads to headaches like this. You should be able to specify the directory where your jar files are located like so:
javac -cp /home/alan/jars main
You can't combine the $CLASSPATH and the -cp option. When you use -cp or -classpath it takes precedence over the environment variable.
Rob Spoor wrote:With that manifest, the JVM is looking for these JAR files in a folder called lib that is in the same folder as the main JAR file. It's not looking in a lib folder inside the main JAR file.