Home > front end >  Java Web couldn't find a Gson with maven import the classes (I use the IDE intellij)
Java Web couldn't find a Gson with maven import the classes (I use the IDE intellij)

Time:12-06

Recently in your Java Web operations run on Tomcat JSP page is always a Java lang. NoClassDefFoundError: com/Google gson/gson, but Java running in the background (not involving the JSP) when the gson class in gson package is maven import without error,

My maven pom. The XML below
 & lt; ? 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
HerbTea
1.0 - SNAPSHOT


Com. Google. Code. Gson
Gson
2.8.5 & lt;/version>


Org. Junit. Jupiter
Junit - Jupiter - api
5.4.0 & lt;/version>
Test


Org. Junit. Jupiter
Junit - Jupiter - api
5.4.0 & lt;/version>
Compile








The picture of the error is as follows:

I try to download the Gson jar then into folders inside and set the jar to the library but still the same error,
Bosses, please can you help to see how to load Gson kit?

CodePudding user response:

The answer please see: https://blog.csdn.net/iwts_24/article/details/84916867

CodePudding user response:

Problem has been solved
  • Related