I running a Java application on an Amazon EC2 instance which is a linux server. I included a json jar in the build path and I checked the class path and it's there. When I import the class
import org.json.*;
I dont get any compilation errors, but when I execute my app I get the ClassNotFoundException.
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/json/JSONException
at Group.run(Group.java:62)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.json.JSONException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Does anybody know how to fix it?