How to download and import items on GitHub from eclipse

Source: Internet
Author: User
Tags svn client git client maven central

Eclipse imports the project by clicking File->import, choosing existing Projects into Workspace

But the premise is that you import this project was originally built with eclipse, otherwise after the import is basically a bunch of error messages, Java development of the IDE in addition to eclipse, as well as idea, NetBeans, etc., if it is other IDE-built projects, can not be imported.

Because of this, projects hosted on GitHub are not configured for an IDE, and only the SRC folder +maven build configuration Files Pom.xml

To import GitHub projects into Eclipse, there are a few steps

1, first to download the project source code to the local

2. Import the source code as a generic project into Eclipse's workspace

3. Convert the original generic project into a Java project or Web project

4. Continue to Maven project, automatically associate and download the corresponding JAR package

5. After the jar package has been downloaded, configure Java Build Path,java Compile

Download source from GitHub

Project source on GitHub supports git and SVN client downloads, and Eclipse has built-in Git client functionality without additional plugins, so you can download the source code directly on eclipse.

To switch to Git view first, choose Clone a git repository

In the URI paste git link, select Next

Select the branch to download, generally only download master, in fact, is the so-called trunk

Import as a generic project

After downloading the source code, you can see the source code that has been downloaded to the local working tree under git repositories.

You can then import them into Eclipse's workspace and select the items you want to import right-click->import Projects

Select Import as General project

Switch to Java or Web project type

After importing workspace as a generic project, this project is only a file project, does not have the function of compiling, releasing, need to turn into Java Project or Web project (according to the type of the source code to judge)

Right-click the project properties and select Project Facets, conver to faceted form.

If this is a Web project, hook up the Dynamic Web module

Add MAVEN Functionality

After turning into a Java project, you will see a lot of code compile error messages, that is because the relevant jar package has not been imported, those associated jar packages, is recorded in the Maven pom.xml configuration file

So to add MAVEN functionality, right-click->configure-Conver to Maven Project

After adding MAVEN functionality, this time eclipse resolves the dependencies information in Pom.xml and downloads the appropriate jar package from the MAVEN central repository

Because the network speed is slow, so download the jar package This is a long process, you have to wait patiently

Configure Java Build path and Java Compile

After MAVEN has downloaded the jar, you may still get a compile error message, change the Java Build path and Java compile to

PS: The above steps may be a bit cumbersome, if you are familiar with the. classpath and. Settings configurations, modifying those configurations directly can also

How to download and import items on GitHub from eclipse

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.