3/30/2011

Run HelloWorld in Eclipse

CREATE JAVA PROJECT

Open workbench




Click on File => New => Java Project


create a project name
  • in JRE part, choose "Use default JRE (currently 'jre 6')"
  • in "project layout" part, "Create separate folders for sources and class files" means to save .java and .class files in different folders.

After clicking Finish icon, you will see the project name on the left of the screen.


CREATE PACKAGE


Click on File => New => Package, or
move your mouse to "src" icon and click right button => New => package


give a name to the package



CREATE JAVA CLASS
  • type "HelloWorld" for the name and do not forget capital "H" and capital "W"
  • choose "public static void main(String[] args), and Eclipse will help that for us



type "System.out.println("HelloWorld");"


click Run as => Java application

click OK


and you will see HelloWorld showed on the button of the screen


IMPORT FILES


General => File System



choose only .java files


FIX PROBLEMS

No comments:

Post a Comment