I import the jar into eclipse through the User libranry of Eclipse, compile no problem, run when the class file is not defined, and later on the online search, the reason to find, is this:
With the Java build path to import the package and copy the package to the Lib there is a difference, it does not conflict, it does not matter, Java build path is the package we need to compile, such as when the import ***.***.*** when the Java build The path import package has a red fork inside the class, saying it does not recognize the class;
Import to Lib is the package that the program needs to run, even if the package imported by Java Build Path is not put into Lib, the classnotfoundexception exception will occur when running the project.
1, first copy the Spring jar package to Web-inf's lib directory
2. Then refresh with F5 in Eclipse to see the newly added jar package from Lib
3, finally add the jar inside the BuildPath, note that the path must be local "/". /..."
Thanks to the original address: 9256291
Here I also summed up a way: here to add their own user Libranry package on the line, here to see more clearly, but also better management.
What's the difference between putting the jar package under project Lib under Eclipse and loading it through BuildPath (to resolve an intermediate method that cannot find the class)