Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
95 views

Eclipse Java Tutorial: 1. Download and Install Java

This tutorial teaches students how to develop Java projects using the Eclipse IDE. It covers downloading and installing the Java Development Kit (JDK) and Eclipse, launching Eclipse, creating a Java project and class, compiling and running a Java program within Eclipse. The document provides step-by-step instructions for creating a new project in Eclipse, generating a Java class, editing the source code, and running the program to view output in the console.

Uploaded by

h
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views

Eclipse Java Tutorial: 1. Download and Install Java

This tutorial teaches students how to develop Java projects using the Eclipse IDE. It covers downloading and installing the Java Development Kit (JDK) and Eclipse, launching Eclipse, creating a Java project and class, compiling and running a Java program within Eclipse. The document provides step-by-step instructions for creating a new project in Eclipse, generating a Java class, editing the source code, and running the program to view output in the console.

Uploaded by

h
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Eclipse Java Tutorial

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

Eclipse is a popular IDE (Integrated Development Environment) for developing software.


You can use Eclipse for programming in Java, C++, and Python, or many other languages.

1. Download and Install Java

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.

2. Download and Install Eclipse

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.

1) How to Install Eclipse on Windows

Step 1: Download Eclipse from https://www.eclipse.org/downloads. Under “Get Eclipse


IDE 2018-12” => Click “Download Packages”. For beginners, choose the “Eclipse IDE
for Java Developers” and “Windows 64-bit” (e.g., "eclipse-java-2018-12-Rwin32-
x86_64.zip" - about 184MB) => Download.
1/4
Step 2: Unzip
To install Eclipse, simply unzip the downloaded file into a directory of your choice (e.g.,
“c:\myproject”).

2) How to Install Eclipse on Mac OS X

Step 1: Go to http://www.eclipse.org/downloads/ Under "Get Eclipse IDE 2018-12" ⇒ Click


"Download Packages". For beginners, select "Eclipse IDE for Java Developers" and "Mac
Cocoa 64-bit". You will receive a DMG file (e.g., "eclipse-java-2018-12-R-macosx-cocoa-
x86_64.dmg").

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!)

3. Developing Java Programs using Eclipse

1) Creating a Java Project


Before creating Java programs in Eclipse, you need to first create a project to hold all
files. Here are the steps to create a Java project in Eclipse:
a) Choose File, New, Java Project to display the New Project wizard, as shown in Figure
3.1.a.
b) Type demo in the Project name field. As you type, the Location field is automatically
set by default. You may customized the location for your project.
c) Make sure that you selected the options Use project folder as root for sources and
class files so that the .java and .class files are in the same folder for easy access.
d) Click Finish to create the project, as shown in Figure 3.1.d.

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) Editing source code

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

Figure 3.4 You can edit a program and run it in Eclipse.

4. Open an existing Java project in Eclipse


1) File > Import > General > Existing Project into Workspace
2) Browse for that directory

4/4

You might also like