Home » Java and Eclipse Setup Guide

Java and Eclipse Setup Guide

1. How to install Java

1. Open your web browser and search for java jdk download
1.1 Click on the link of Oracle download page:

Search Java jdk Download

1.2 The following page would be displayed:

Java SE Download

1.3 Scroll down the page a little
1.4 Download the executable file corresponding to your operating system

Java SE Development Kit Downloads 1
Java SE Development Kit Downloads 2

1.5 Accept the license agreement for Oracle and click on download JDK

jdk License Agreement

1.6 Open the executable file

Open jdk Executable File

1.7 After opening the file, it will prepare to install

jdk Installation

1.8 Click Next to continue

Development Kit Setup 1
Development Kit Setup 2

1.9 Windows has successfully installed Java.

2. To verify that Java is being setup properly in the system

2.1 Open command prompt in your system
2.2 Type javac and press enter
2.3 If the below screen has appeared in your system it means that the java JDK has not setup properly (path has not setup):

Command Prompt Java Setup

3. How to set the Java path

3.1 Open the Settings and click on system option

Windows Settings
Environment Variables

3.2 Search for environment variables and select edit the system environment variables

3.3 Following screen would be displayed then select environment variables:

System Properties

3.4 Select the path under system variables and click on edit
3.5 The below page would be displayed:

Select Environment Variables
Edit Environment Variables

3.6 Open File Explorer and go the folder where your jdk is installed
3.7 Click on JDK >>bin
3.8 Copy the location of JDK bin and paste it the Path under system variable which you have to edit

Location JDK Bin 1
Location JDK Bin 2
Location JDK Bin 3

3.9 After editing the location press OK for the remaining prompt screens

Edit Environment Variables 2

3.10 Open the command prompt again and type java -version

Command Prompt Java Version

3.11 The path of Java is set and it is verified now.

4. How to download Eclipse IDE in Windows

4.1 Open your browser and search for EclipseIDE

Search for EclipseIDE

4.2 Click on the link of eclipse.org download page
4.3 The following page would be displayed:

EclipseIDE Page

4.4 Click on the download button and you will be directed to the following page:

EclipseIDE Download Button

4.5 Again click on the download button for Eclipse IDE
4.6 On clicking further, the executable file will start downloading

EclipseIDE Download Complete

4.7 Double click on Eclipse executable file

EclipseIDE Executable File

5. How to install Eclipse IDE in Windows

5.1 You will see that the Eclipse installer has started and following interface would be displayed in your screen

EclipseIDE Installer

5.2 Click on Eclipse IDE for Java Developers

EclipseIDE Installer 2

5.3 After clicking the following page would be displayed:

EclipseIDE Installer 3

5.4 Click on the INSTALL button and it will prepare to install

EclipseIDE Installer 4
EclipseIDE Installer 5

5.6 Check the remember accepted certificates checkbox and click on Accept selected

EclipseIDE Installer 6

5.7 Launch the Eclipse installer

EclipseIDE Installer 7

6. How to setup workspace in Eclipse

Workspace in Eclipse

6.1 Now select the directory as your workspace you have to select the path/location where your Java projects will be stored (Setting up the workspace)
6.2 After setting the path of directory, if you want to choose it as default then check the checkbox as shown below:

Setting Path for Workspace

6.3 The Eclipse IDE has started now the welcome screen would be shown

Eclipse IDE Welcome Screen

7. How to set up a Java project in Eclipse

7.1 Close the welcome screen
7.2 Click on File>>New>>JavaProject

New Java Project

7.3 Set the name of the project as “DevLabs Alliance Project”

Name Java Project

7.4 Further click on Finish button and then the below screen would get displayed .Now if you want to create a module then click on Create otherwise click on Don’t Create

Create Module Java Project

7.5 The DevLabs Alliance Project has been created

Java Project Created

8. How to write first Java program

8.1 Right click on the src folder as shown below and then select New>>Java Class

New Java Class

8.2 Set the name of the class as DevLabFirstClass and the name of the package as com.dla and we would be creating a public static void main method so check that option and then click on Finish button as shown below:

Set New Java Class

8.3 Now under the main method write System.out.print(“DLA Project”);

Method System Out Print

8.4 Now right click anywhere on the screen and select Run as >> Java Application

Run Java Application

8.5 After clicking on Java Application the below screen would get displayed:

Save and Launch Application

8.6 Click OK.
8.7 After running the Java application, it will print DLA Project in console.

Print in Console