New York University



Eclipse IDE (for Java) tutorial on Windows XP (32 bit), “Hello World”:

1. The Eclipse IDE requires a Java runtime installed.

→ Most OSes have some version of the Java runtime installed already. Java 5 - or Java 1.5 - is currently recommended by the Eclipse developers, however Java 6 worked fine for me.

→ The latest java runtime can be found here: .

2. Download “Eclipse IDE for Java Developers”

→ downloads/moreinfo/java.php.

→ Unpack the file into a directory that does not contain spaces, such as “c:\eclipse”

3. Open “eclipse.exe” in the root directory of the eclipse folder you unpacked.

→ Eclipse will prompt for a workspace directory. The workspace is the place where you store your Java projects.

[pic]

4. At first a welcome page will open. Close the welcome page by pressing the "X".

5. Create a new project (File->New->Java Project) and fill in the appropriate forms. Click next then finish when done:

[pic]

6. Create a package. Our convention will be to name this package the same as the project (HelloWorld) as it will contain the “public static void main()” function.

→ Right-click on “src” under the “HelloWorld” project (in the Package Explorer window) and choose New -> Package.

[pic][pic]

7. Create a new class called Main. Be sure to select the flag for “public static void main(...)”

→ Right-click on the HelloWorld package and choose New -> Class.

[pic][pic]

8. In main() function add the following line in the main function.:

[pic]

9. Now run your package as a java application by right-clicking on the HelloWorld package and selecting: Run as -> Java Application.

[pic]

→ You should find the output in the Console window:

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download