Eclipse (a Java IDE) - First Steps
(Free Web Tutorial)
by Michael Thomas
Eclipse Home Page
Description:
Install Eclilpse SDK, create your first Java Project and then
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,
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.
- JDK version used to compile java programs
- Sorry, I don't know where to locate this
information. Email me if you know.
Eclipse Install - Eclipse SDK 3.1.1
- Prerequisites - JRE (Java Runtime Environment)
- Download Eclipse
- http://www.eclipse.org
- Click "Downloads" tab at the top.
- Click on the Disk-to-Computer icon called "Download now: Eclipse
SDK x.x.x"
file: eclipse-SDK-3.1.1-win32.zip
- 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.