I am trying to learn how to use JSON and write a simple program, however whenever I create an instance of a JSON object it fails. What am I missing if I get this error when trying to create an instance of JSONObject or JSONArray. I added http://sourceforge.net/projects/json-lib/files/ this JSON library to the build path. Is there something I can't see?
The error message is as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at jsonexp.JSONexp.<init>(JSONexp.java:36) at jsonexp.JSONexp.main(JSONexp.java:55) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
I found out that such an error occurs when the library used depends on another library.
I do not know how to deal with this problem, and I really appreciate the help.
Thanks.
source share