Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Java Development User Guide
Previous Page Home Next Page

Creating your first Java project

In this section, you will create a new Java project. You will be using JUnit as your example project. JUnit is an open source unit testing framework for Java.

Getting the Sample Code (JUnit)

First you need to download the JUnit source code.

  1. Click here to download the JUnit source code.
  2. Save the archive (do not extract) to a directory from now on referenced as <Downloads>.

Creating the project

  1. Inside Eclipse select the menu item File > New > Project.... to open the New Project wizard
  2. Select Java Project then click Next to start the Open the new Java project wizard New Java Project wizard:

    New Java Project wizard

    On this page,
    • type "JUnit" in the Project name field, and
    • select "J2SE-1.4" in the Use an execution environment JRE field.
    Then click Finish.
  3. In the Package Explorer, expand the JUnit project and select the source folder src.
  4. Select the menu item File > Import....
  5. Expand General, select Archive file, and click Next.
  6. Click the Browse button next to the Archive file field and browse to select

    <Downloads>/junit381src.jar

    Note: This step assumes that you followed steps 1 and 2 in the Getting the Sample Code section above.
  7. In the Import wizard, expand the root node, press Deselect All and select only the junit node. You can expand and select elements within the junit directory on the left pane to view the individual resources that you are importing on the right pane. Note: Do not deselect any of the resources in the junit directory at this time. You will need all of these resources in the tutorial.

    Import archive wizard

  8. Make sure that the JUnit project's source folder appears in the destination Into folder field. Then click Finish. In the import progress indicator, notice that the imported resources are compiled as they are imported into the workbench. This is because the Build automatically option is checked on the Workbench preferences page.
  9. In the Package Explorer view, expand the JUnit project and the src folder to view the JUnit packages.

    Package explorer

Related concepts

Java projects
Java views

Related reference

New Java Project Wizard
Package Explorer View


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire