Im using IBM Bluemix’s Java For Liberty to deploying a web app.
I was trying to get the system env and converted it to JSONObject
And I pretty sure Ive added the jar file to the classpath
However, after I ran the app(tried push to bluemix cloud and running locally in a liberty profile app server), it throws java.lang.NoClassDefFoundError
please indicate how should I configure…..
Answer
The jars in the dep-jar
folder do NOT get packaged with the final application binary(war). It is meant to be used during compilation only. If you want the jar to be included in the war (use during runtime), you need to include it in WebContent/WEB-INF/lib
folder.
If you create and download the Java DB Web Starter
boilerplate, you will see the right structure set up – WebContent/WEB-INF/lib/nosqljson.jar