Eclipse Java Tutorial: 1. Download and Install Java
Eclipse Java Tutorial: 1. Download and Install Java
This tutorial is for students who want to develop Java projects using Eclipse. It covers the
following topics:
Download and install JDK
Download and install Eclipse
Launch Eclipse
Create a Java Project
Create a Java Program
Compile and Run a Java Program
Java is a full-fledged and powerful language that can be used in many ways. It comes in three
editions:
Java Standard Edition (Java SE) to develop client-side applications. The applications
can run standalone or as applets running from a Web browser.
Java Enterprise Edition (Java EE) to develop server-side applications, such as Java
servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).
Java Micro Edition (Java ME) to develop applications for mobile devices, such as cell
phone.
This course uses Java SE to introduce Java Programming. Java SE is the foundation upon
which all other Java technology is based. There are many versions of Java SE. Make sure that
you download JDK 8 or above: https://www.oracle.com/java/technologies/javase-downloads.html.
Eclipse is free popular integrated development environment for developing Java programs.
You can edit, compile, run, and debug Java Programs using Eclipse. It is easy to learn if you
fellow simple instructions.
Note that, to use Eclipse for Java programming, you need to first install JDK.
Step 2: Double-click the downloaded Disk Image (DMG) file. Follow the screen
instructions to install Eclipse. Eclipse will be installed under "/Applications/eclipse". (To
confirm!)
Figure 3.1.a The new Java project dialog is for specifying a project. Figure 3.1.d. A new Java project named demo is created.
2/4
2) Creating a Java class
After a project is created, you can create Java programs in the project using the following
steps:
a) Choose File, New, Class to display the New Java Class Wizard.
b) Type Welcome in the Name field.
c) Check the option public static void main (String[] args).
d) Click Finish to generate the template for the source code Welcome.java, as shown
in Figure 3.2.d.
Figure 3.2.d The New Java Class dialog is used to create a new Java class.
3/4
4) Compiling and Running a Class
To run the program, either right-click the class in the project or right-click in the Java
class and select Run-as > Java Application. The output is displayed in the Console pane
as shown in Figure 3.4.
Edit pane
Output pane
4/4