Question

I have a little app that uses

import simple.http.Request;
import simple.http.Response;
import simple.http.load.BasicService;
import simple.http.serve.Context;
...

When running the jar file (java -jar test2.jar) I receive this error

Exception in thread "main" java.lang.NoClassDefFoundError: simple/http/serve/ResourceEngine
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
    at java.lang.Class.getMethod0(Class.java:2685)
    at java.lang.Class.getMethod(Class.java:1620)
    ...

Google-ing I have found that that class (simple.http.serve.ResourceEngine) is part of simple-2.7.jar.

I have modified MANIFEST.MF file like this

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.0
Created-By: 1.7.0_17-b02 (Oracle Corporation)
Main-Class: com.App.Main
Class-Path: simple-2.7.jar

downloaded simple-2.7.jar and copied near my jar file the but the error persist

I an NB in java. Can you help with info how to make the jar work ?

Was it helpful?

Solution

Try running the java program by using this command instead

java -jar test2.jar -cp simple-2.7.jar

Hope simple-2.7.jar is in the same directory

OTHER TIPS

You have to add simple-2.7.jar to your classpath.

http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/classpath.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top