Reputation: 4113
I am working in Eclipse. I want to use JSON object in my servlets, so I attached jar file in library for JSON.
Now it shows all JSON classes in intellisense, but it giving run time exception
java.lang.NoClassDefFoundError: org/json/JSONArray
Can somebody suggest me how can I resolve this exception?
Upvotes: 0
Views: 1138
Reputation: 22415
Adding a jar to your build path in Eclipse isn't enough. The jar must be in the WEB-INF/lib directory for it to load at runtime, which if your project is set up as a Dynamic Web Project, automatically sets those jars on the build path.
Upvotes: 3