General steps for importing an open-source project to eclipse
Zhou yinhui
After downloading it to an open-source project, we still want to import it to eclipse. The general steps are as follows:
Open the source code directory,
- If you see. Calsspath. projectFile, it indicates that this project was originally developed by eclipse, so in eclipse-> file-> Import-> existing project
- If you seeBuild. xml, It indicates that this project is built by ant. Refer to the "import ant project" section below"
- If you seePom. xmlFile, it indicates that this project is built by Maven. Refer to the "Import Maven project" section below"
- For others, create a project and import the source code.
About importing ant Projects
This is relatively simple. Open eclipse, file-> New-> Project (yes, you are not mistaken, it is new, not import)
Select "Create a java project from the existing ant build File", next, take a project name, and specify the location of the build. xml mentioned above.
About importing Maven Projects
Maven is a construction tool, which is similar to make, clearmake, and ant.
First, install Java, and then:
1. Download
Http://maven.apache.org/download the compressed package and decompress it to a directory.
2. Configure Environment Variables
Open the environment variable settings and add the Maven installation location to the path. For example, my path is:
C: \ jdk1.8.0 \ bin \; C: \ Program Files (x86) \ apache-maven-3.2.1 \ bin
Open a new cmd and enter mvn-v to view the version information.
3. After Maven is installed, go to the source code directory, open cmd, enter mvn eclipse: eclipse, and press Enter. At this time, maven converts the mvn project under the directory to an eclipse project (after the conversion is complete, you will find that there are more projects under the directory. calsspath. project file). At this time, you can go back to the first case mentioned above and import it directly.
In addition, maven has an eclipse plug-in. You can click eclipse Marketplace under the Eclipse help menu and search for and install it in the market.
Then, you can use the GUI to import the mvn project.