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, the Java build path is the package we need to compile, such as in the import ***.***.*** If you do not use the Java Build Path import package, there is a red fork in the class, saying that the class is not recognized;
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 jar package to the project 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 "/". /..."
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)