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

Java Programming Setup

JPR

Uploaded by

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

Java Programming Setup

JPR

Uploaded by

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

Step-by-step guide to installing Oracle JDK (Java Development

Kit), setting up environment variables, and installing Eclipse IDE


on Windows

Installing Oracle JDK

1. Download Oracle JDK:

- Visit the [Oracle JDK download


page](https://www.oracle.com/java/technologies/javase-jdk17-downloads.html).

- Accept the license agreement.

- Download the appropriate JDK installer for your Windows version (e.g.,
Windows x64 installer).

2. Run the JDK Installer:

- Once downloaded, run the JDK installer (.exe file).

- Follow the installation wizard instructions.

- Choose the default installation path or specify a custom one. Note down the
installation path for later use.

3. Set JAVA_HOME Environment Variable:

- Right-click on "This PC" or "Computer" on your desktop or in File Explorer.

- Click on "Properties" -> "Advanced system settings" -> "Environment


Variables".

- Under "System variables", click "New".

- Variable name: `JAVA_HOME`

- Variable value: Enter the path to your JDK installation directory (e.g.,
`C:\Program Files\Java\jdk-17`).
4. Update PATH Environment Variable:

- In the "System variables" section, find the `Path` variable and click "Edit".

- Add the following entry to the end of the variable value:

;%JAVA_HOME%\bin

- Click "OK" to save.

5. Verify JDK Installation:

- Open Command Prompt.

- Type `java -version` and press Enter.

- Type `javac -version` and press Enter.

- Both commands should display the version of Java installed (e.g., Java 17).
Installing Eclipse IDE

1. Download Eclipse IDE:

- Visit the [Eclipse download page](https://www.eclipse.org/downloads/).

- Choose "Download Packages" and select "Eclipse IDE for Java Developers".

- Download the appropriate installer for your Windows version (e.g.,


Windows 64-bit).

2. Run the Eclipse Installer:

- Once downloaded, run the Eclipse installer (.exe file).

- Select "Eclipse IDE for Java Developers" and choose a suitable installation
directory.

- Follow the installation wizard instructions to complete the installation.

3. Launch Eclipse:

- After installation, navigate to the Eclipse installation directory and find the
executable (e.g., `eclipse.exe`).

- Double-click on `eclipse.exe` to launch Eclipse IDE.

4. Configure Eclipse:

- When Eclipse starts, it will prompt you to select a workspace (default


location where your projects will be stored).

- Choose a workspace directory or accept the default.

- Click "Launch" to open Eclipse.


5. (Optional) Configure JDK in Eclipse:

- Go to `Window` -> `Preferences`.

- Expand `Java` -> `Installed JREs`.

- Click "Add" to add the JDK installation.

- Select "Standard VM", click "Next", and then browse to the JDK installation
directory (`C:\Program Files\Java\jdk-11`).

- Click "Finish" and ensure the added JDK is checked as the default.

Verify Eclipse Setup

1. Create a New Java Project:

- In Eclipse, go to `File` -> `New` -> `Java Project`.

- Enter a project name and click "Finish".

- You should see the new Java project in the Package Explorer on the left.

2. Write and Run a Simple Java Program:

- Right-click on the `src` folder in your new Java project.

- Select `New` -> `Class`.

- Enter a class name (e.g., `HelloWorld`) and check "public static void
main(String[] args)".

- Click "Finish" to create the class.

- Write a simple Java program (e.g., print "Hello, World!") inside the `main`
method.

- Right-click on the Java file -> `Run As` -> `Java Application`.

- Verify that the program runs and outputs correctly in the Console view.
This completes the installation and setup of Oracle JDK, environment variables,
and Eclipse IDE on Windows. You should now be ready to develop Java
applications using Eclipse IDE.

You might also like