I have created jar in folder /usr/local/bin/niidle.jar.
Manifest-Version: 1.0
Main-Class: com.ensarm.
Line niidle.jar/lib/hector-0.6.0-17.jar is confusing. Is niidle.jar directory or file? I'd suggest you to post your full manifest, directory structure, command line you are using and current working directory.
But generally you should write in your manifest: Class-Path: hector-0.6.0-17.jar
then put all jars in one directory. Let's call it foo
.
Now open command prompt, go to foo and run
java -jar niidle.jar args...
And I believe that everything will work. Then if you wish play with location of your jars.
java -cp /Projects/EnwelibDatedOct13/Niidle/lib/hector-0.6.0-17.jar -jar /usr/local/bin/niidle.jar arguments.....
You can't use the -cp
switch together with the -jar
switch.
From http://mindprod.com/jgloss/classpath.html:
If you use the -jar option, java.exe ignores the classpath. It will only look in that jar!! Try using the manifest Class-Path instead to get Java to look in auxiliary jars
And I have added this 'hector-0.6.0-17.jar' in niidle.jar folder as follows:
To my knowledge, you can't nest .jar
files this way.
Since you have Class-Path: hector-0.6.0-17.jar
you need to have the needle.jar
and the hector-0.6.0-17.jar
side by side and run niidle.jar
from their common directory (using the -jar
switch if you like).
For setting up "jars within jars" take a look at this question:
Classpath including JAR within a JAR