Difference between revisions of "Import Java code examples into Eclipse using Git"

From Knowledge Kitchen
Jump to navigation Jump to search
m
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
== Overview ==
 
== Overview ==
 
Readymade code examples in Java for this course are publicly [https://github.com/bloombar/java-examples available on GitHub], an online resource for sharing and collaborating on code.  It is possible to manually download these examples and then manually import each into Eclipse.  However there is an easier way using a code versioning and sharing tool called Git.
 
Readymade code examples in Java for this course are publicly [https://github.com/bloombar/java-examples available on GitHub], an online resource for sharing and collaborating on code.  It is possible to manually download these examples and then manually import each into Eclipse.  However there is an easier way using a code versioning and sharing tool called Git.
 +
 +
Note that if you are using the command line, there are [[Import Java code examples using Git|separate instructions for downloading these Java examples from the command line]].
  
 
== Importing into Eclipse ==
 
== Importing into Eclipse ==
Line 37: Line 39:
  
 
[[Image:Git_import_into_eclipse_step9.png|frame|none|Step 9 - Make a git pull request to fetch updates]]
 
[[Image:Git_import_into_eclipse_step9.png|frame|none|Step 9 - Make a git pull request to fetch updates]]
 +
 +
 +
 +
{{Template:Inbound links|page={{PAGENAMEE}}}}

Latest revision as of 12:51, 12 September 2019


Overview

Readymade code examples in Java for this course are publicly available on GitHub, an online resource for sharing and collaborating on code. It is possible to manually download these examples and then manually import each into Eclipse. However there is an easier way using a code versioning and sharing tool called Git.

Note that if you are using the command line, there are separate instructions for downloading these Java examples from the command line.

Importing into Eclipse

In sum, you will automatically download the examples from GitHub and automatically import them each into your Eclipse workspace. You do this by using Eclipse's Git integration.

Follow the steps outlined in the screenshots below.

Step 1 - Select File->Import...
Step 2 - Select Git->Projects from Git
Step 3 - Select Clone URI
Step 4 - Enter GitHub repository details
Step 5 - Select the master branch
Step 6 - Select a local directory where the examples will be saved
Step 7 - Select to import existing Eclipse projects
Step 8 - Select all projects

Continue to completion and the examples will then appear in the list of projects in your Eclipse workspace.


Downloading updates

The examples may be modified from time-to-time by the instructor. Whenever you'd like to make sure you have the latest version of the examples, use Git's pull feature to automatically download updates.

Do this by right-clicking or control-clicking on any file in one of the readymade examples in Eclipse. Then select the menu option outlined in the screenshot below:

Step 9 - Make a git pull request to fetch updates


What links here