With the release of MANIFEST.MF in the bank

I created a jar for my project, I have a problem with MANIFEST.MF. The structure of my MANIFEST.MF is as follows:

------------------------
Manifest-Version: 1.0
Main-Class: com.ensarm.niidle.web.scraper.NiidleScrapeManager
Class-Path: /Projects/EnwelibDatedOct13/Niidle/lib/hector-0.6.0-17.jar
----------------------------

when i run this command:

>>java -jar /usr/local/bin/niidle.jar arguments...

then its correct work ..... but i don't want the full class name.

So, when the structure of my MANIFEST.MF looks like this: and I want this to be done using the following class:

---------------------
Manifest-Version: 1.0
Main-Class: com.ensarm.niidle.web.scraper.NiidleScrapeManager
Class-Path: lib/hector-0.6.0-17.jar
----------------------------

and now when I run this with the command:

>>java -jar /usr/local/bin/niidle.jar arguments...

then it shows an error: ---

---Exception in thread "main" java.lang.NoClassDefFoundError: me/prettyprint/hector/api/Serializer
    at com.ensarm.niidle.web.scraper.NiidleScrapeManager.main(NiidleScrapeManager.java:21)
Caused by: java.lang.ClassNotFoundException: me.prettyprint.hector.api.Serializer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    ... 1 more

Please tell me the solution for this .....

+3
source share
1 answer

Obviously, the required library is not in the actual class path. It says here:

URL- Class-Path URL- JAR .

, java hector () :

/usr/local/bin/lib/hector-0.6.0-17.jar

, java -jar, classpath manefest , -cp $CLASSPATH .

+1

Source: https://habr.com/ru/post/1784970/


All Articles