When introducing a project from the outside to your own eclipse, pay attention to three points: the environment (JDK version, javaee version, and Android version) used before the project is written) the encoding method before the project and the external package introduced before the project.
Previously, when I introduced a Java project from outside:
1) there is a red cross in front of the project. The source code file in the project is not wrong, and the project can run normally during running. However, when you modify the project code and run it, you may encounter an exception of class not Foundation exception. When you go to the project folder to view the compiled code. class file, you will find that the project does not. class file. Or when you see an error in the source code after the project is introduced, use clean and build, when you view the class file in the project, you will also find that there is no class file in the class folder. And the class file will not be regenerated when you compile and run the project again. Then the entire project cannot run. Maybe you can delete the entire project, create a new project in eclipse, and introduce the source files in the previous project one by one, instead of introducing the entire project to solve this problem.
This situation is caused by inconsistent JDK or Java ee versions used during the project compilation and running with the default version in eclipse. You can view the JDK version used for compiling and running the project, and use the same version in your eclipse.
2) there is a red cross in front of the project. There is no error message in the Code and the class file also exists, but the project cannot run normally. It may be that an external package has been introduced before the project, but the external package is not put in the project, but outside the project file. The package cannot be found when it is introduced from the outside. Right-click the project --> build path --> Configure build path --> libraries to check whether there is a red cross. If there is a small Red Cross, first Delete the bag with a small red cross in front, and then re-introduce it.
3) if the encoding method used before the project is different from that used after the project is introduced, Chinese characters in the project may be garbled and may cause errors. The solution is to change the coding method of the entire project or the encoding method of a file in the project.
When introducing the android project:
1) when the android project is introduced, there is a Red Cross before the project. The API version before the project is different from the default API version in eclipse. in properties, replace target = Android-10 with the version of the API used in eclipse.