Professional Documents
Culture Documents
Start Java Programming in Eclipse
Start Java Programming in Eclipse
Start Java Programming in Eclipse
OUTLINE
1. From the Start menu, select the Eclipse icon to start it. Eclipse prompts you for a workspace, as
follows:
A workspace is a location in the computer file system where your Java projects and other
resources are stored. In the screenshot above, a folder named workspace is created as the
workspace folder. You can choose any accessible folder of your desire as the workspace.
2. Select Launch button to start. To create a Java project, select File, New, Java Project.
3. In the New Java Project dialog, type a project name and select the Finish button.
The Package Explorer allows you to browse the structure of your projects, create, rename or
add files. Next, create a package in the created project my java project. Java package is a way
of organising java files into, well, packages.
5. To create a package, right-select the project name my java project, then select New, Package,
Type a package name.
Note: package name needs to follow Java identifier naming rules. For example, white space
characters are not allowed in package name.
8. In the main method, type your first line of Java code, System.out.println(“Hello world”);.
10. The result of running the Java program is displayed in the Console window, as below.
At some point of the course, you may have to create text files as data source. For your Java program
to access the data, text files need to be created at the top level of Java project.
1. To create a folder at the top level, right-select project name, New, Folder.
Note, you must right-select on the project name, not any component inside the project.
Otherwise, the folder won’t be created at the top level.
4. The following screenshot shows your project structure. The src folder contains the java files,
while the data folder contains the text files.