Eclipse (a Java IDE) - First Steps
(Free Web Tutorial)
by Michael Thomas
Eclipse Home Page
In this tutorial you will install Eclilpse SDK, create your first Java Project and then
create the Java Cert project for the "Free Java Core & Certification Training
Web Tutorial".
Note: On the UML Home page, you can download
the whole UML site (all content, tutorials & examples) !!!
This tutorial covers: Eclipse 3.3.2
for JEE (has many Europa features) (as of 05/18/08)
Prerequisites
- Have JDK 5 or high installed.
- This tutorials has been tested in the following environment:
Date: 05/19/08
OS: Win XPro
JDK: jdk1.6.0_03
Objectives
- Install Eclilpse SDK,
- Create your first Java Project
- Create the Java Cert project for the "Free Java Core & Certification Training
Web Tutorial".
IDE - Interactive Development Environment
Eclipse General Info
- Eclipse version - Help, About SDK
- JVM version used to run programs:
- Launch Eclipse. Help, About SDK,
- Click "Configuration Details".
- You can see what Java VM is used to run your programs.
- java.vendor - Java vendor.
- java.version & java.vm.version - Java version.
- Click "Feature Details" to see all the features you have or have
added.
- Click "Plugin" to see the plugins.
- JDK version used to compile java programs
- Sorry, I don't know where to locate this
information. Email me if you know.
FYI - Possible Errors:
Eclipse Install - Eclipse SDK 3.3.2
- Prerequisites - JRE (Java Runtime Environment)
- Download Eclipse
- www.eclipse.org
- Click "Downloads" tab at the top.
- Click on: "Windows" across from Eclipse IDE for Java EE
Developers - Windows (126 MB) - this is the most complete
package of the list. Has everything but the C/C+ feature.
Download filename: eclipse-jee-europa-winter-win32.zip - 130mg
(has Eclipse 3.3.2)
Contains:
- RCP/Platform
- CVS
- EMF - Eclipse Modeling Framework
- GEF - Graphical Editing Framework
- JDT
- Mylyn
- PDE
- DTP - Data tools
- JST
- Optional Europa features you can add:
- Ruby Development Tools (DLTK)
Test and Performance Tools (TPTP)
Graphical Modeling Framework (GMF)
- FYI Information:
- Click on one of the download sites.
- Click on the Disk-to-Computer icon called "Download now: Eclipse
SDK x.x.x"
file: eclipse-SDK-3.1.1-win32.zip
- If updating Eclipse to a newer version - if you are upgrading
your Eclipse version read these notes.
- I like to launch my current version of Eclipse, click "Help", then
"About Eclipse SDK" and write down the version.
- Next, I'll rename my current directory from "c:\eclipse" to
"c:\eclipse_x.x.x" (using the version # for the Xs). This way you can
still launch the old version if you want to.
- Note: Normally all of your projects will still show up because you
will specify your eclipse workspace which has the meta data.
- Install Eclipse
- Extract the zip file to: C:\
Note: The files will be extracted to: C:\eclipse\...
Make sure that zip programs "Use folder names" is enabled.
- Launch Eclipse
- Optional (Win XP) - Create an entry in "Start", "All Programs"
- Right click on "Start", choose "Explorer all users",
- Click on "Programs"
- Click "File", "New", "Shortcut"
- For location of item, browse to:
C:\eclipse\eclipse.exe
- Click next.
- Name for the shortcut: Eclipse
- Click "Finish"
- Click "Start", "All Programs"
- Click "Eclipse" to launch the program.
Create a Test Java Project & Java Class
- Create a test Java Project
- File, New, Project
- Click "Java Project", then Next
- Project name: MyJavaTest
- Click "Finish"
- Create a new Java Class
- File, New, Class
- Source Folder: should be defaulted to "MyJavaTest" which was
created above.
- Name: MyApplication
- Click "Finish"
- Make the java class have the following code:
public class MyApplication {
public static void main( String [] args ) {
System.out.println("Hello World from an Application.");
}
}
- Save the application with "Ctrl-S".
- Click "Run", "Run As", "Java Application"
- In the "Console" window at the bottom you
should see the following:
Hello World from an Application.
- Click the "Clear Console" icon (Paper with an X in it).
- Congratulations - you have created and tested you first Java
Application.
- Notes
Setup a Project for "javacert"
- You can setup Eclipse to access all of my Java Certification examples
that I have at my web site on your local PC.
- Click on the link below and look for the section titled "Download
Files". Extract the zip file into a directory. When you extract the
file it will create a directory called "javacert".
Free Training: Sun Certified Java Programmer
Exam
- Launch Eclipse
- Create a Java Project.
- File, New, Java Project, Next
- Project Name: javacert
- Contents: "Create project from existing source".
- Click "Browse" and locate the directory you extracted (ie: javacert).
Click "Finish"
- On the "Java Settings" screen, click "Finish"
- Change the output folder.
- Project, Properties
- Click "Java Build Properties"
- Default Output folder: javacert\classes
- Now you can edit and run the source code at my web site on your
local PC using Eclipse - HAVE FUN.