problem related to MANIFEST.MF in jar

后端 未结 3 1653
挽巷
挽巷 2021-01-23 15:59

I have created jar in folder /usr/local/bin/niidle.jar.

And I have cerated MANIFEST.MF in jar as follows:

Manifest-Version: 1.0
Main-Class: com.ensarm.         


        
3条回答
  •  星月不相逢
    2021-01-23 16:58

    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).

提交回复
热议问题