Java. Lang. NoClassDefFoundError: org/json/JSONObject
My pom. XML
<? The XML version="1.0" encoding="utf-8"?>XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" & gt;4.0.0 & lt;/modelVersion> Org. Example Untitled 1.0 - SNAPSHOT Org, apache maven. Plugins Maven - jar - plugin Com. Example. Test //main program entrance class, can hold the control, stand-alone positioning to the classOrg, apache maven. Plugins Maven - compiler - plugin Cn. Hutool Hutool - http 5.5.1 & lt;/version> Cn. Hutool Hutool - crypto 5.5.1 & lt;/version> Cn. Hutool Hutool - core 5.5.1 & lt;/version> Cn. Hutool Hutool - extra 5.5.1 & lt;/version> Cn. Hutool Hutool - cron 5.5.0 & lt;/version> Org. Json Json 20190722 & lt;/version>
CodePudding user response:
The JVM at run time will find the corresponding class in the classpath to load, but when it can't find the class, a Java has taken place. The lang. NoClassDefFoundError error, if the class you didn't take good care of the packaging to get lost