0% found this document useful (0 votes)
1 views

Guide+to+Install+Oracle+Java-JDK+%28Java+Development+Kit%29+%282%29

This document provides a step-by-step guide to install Oracle Java-JDK on Windows, MacOS, and Ubuntu. It includes instructions for downloading the JDK, setting environment variables, and verifying the installation. The guide emphasizes the importance of using the latest JDK version and contains specific commands for each operating system to ensure successful installation.

Uploaded by

Sucheta Banerjee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Guide+to+Install+Oracle+Java-JDK+%28Java+Development+Kit%29+%282%29

This document provides a step-by-step guide to install Oracle Java-JDK on Windows, MacOS, and Ubuntu. It includes instructions for downloading the JDK, setting environment variables, and verifying the installation. The guide emphasizes the importance of using the latest JDK version and contains specific commands for each operating system to ensure successful installation.

Uploaded by

Sucheta Banerjee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Guide to Install Oracle Java-JDK (Java Development Kit)

JDK is a java tool kit which contains JVM (Java Virtual Machine), Interpreters/loader, javac
compiler, Java documentation generator (Javadoc) and many more to accomplish our tasks.
The below steps are to be followed to install and set up java environments so that IDE’s like
Apache, Eclipse, IntelliJ IDEA, BlueJ and many more can use the JDK tools.

For Windows:

Step 1: There are many JDK’s developed by different companies. The most frequently used
JDK is Oracle JDK. Click here to visit the official website of Oracle Java SE (Standard Edition).
Click on “JDK Download”.

[email protected]
1FSBWQC5AJ

Note: The latest JDK versions might differ when you are going through this document, as Java
might release new versions in time intervals. Hence, Install the latest Jdk version.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 2: Find the compatible version for your PC and click on the link. Accept the permission and
click download.

[email protected]
1FSBWQC5AJ

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 3: Go to the downloaded location and double click on the .exe file.

Step 4: Click “Yes” to begin your installation.

[email protected]
1FSBWQC5AJ
Step 5: Click on the “Next” button.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 6: Click on the “Next” button.

Step 7: Wait till the Installation is complete.


[email protected]
1FSBWQC5AJ

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 8: Explore the documentation by clicking on “Next Steps” or click “Close”.

Step 9: Search for “Edit the system environment variables” and open.

[email protected]
1FSBWQC5AJ

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 10: Click on the “Environment Step 11: Click on “Path” in system variables
Variables” button. and click the “Edit” button as shown below.

[email protected]
1FSBWQC5AJ

Step 12: Click on the “New” button.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 13: A java file will be installed in Program Files.
Go to Java/jdk-16.0.1/bin and copy the path.

Example: C:\Program Files\Java\jdk-16.0.1\bin

[email protected]
1FSBWQC5AJ

Step 14: Create New Home Variable called “JAVA_HOME” and add the path to the jdk file as
given below and click “OK”.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
Step 15: Click “OK” and close the Environment variables and System Properties windows.

[email protected]
1FSBWQC5AJ

Step 16: Check the version of java in the command prompt by typing “java -version”. You will
find the installed version of java as given below.

Congratulations! Your Jdk is Installed successfully.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
For MacOS:

Step 1: There are many JDK’s developed by different companies. The most frequently used
JDK is Oracle JDK. Click here to visit the official website of Oracle Java SE (Standard Edition).
Click on “JDK Download”.
Step 2: Find the compatible version for your PC and click on the link. Accept the permission and
click download. (Here I am using a .dmg file)
Step 3: Click on the downloaded file and double click on the .pkg file in it and click “continue”.
Step 4: Click on the Install button and enter your macOS Password and click “Install Software‘
button.
Step 5: After you install the software you will find the Installation Successful message. Now
close all the windows.
Step 6: Create an environmental variable by typing “echo $JAVA_HOME” in the terminal.
Step 7: Change directory to check the path of java_home. Execute “cd /usr/libexec/” command
and execute “ls -ltr” to see the java_home in the specified directory.
Step 8: Execute the “pwd” command to get the path of the directory and use this path in the
bash file. So copy the path.
Step 9: Open bash profile by typing “open -e .bash_profile”. If it is not available, create by typing
“touch .bash_profile”.
Step 10: Check if bash profile is created by executing “ls -al” in terminal.
Step 11: Open bash_profile with “open -e .bash_profile” command. It opens a text document.
[email protected]
1FSBWQC5AJStep 12: Enter the export command as “export JAVA_HOME=$(paste the copied path and
then/java_home)” in bash_profile.
Step 13: Save and close the bash profile.
Step 14: Restart the terminal by closing and opening the terminal.
Step 15: Execute “echo $JAVA_HOME”. You will see the path of the home and the version of
the jdk file.

Congratulations! Your Jdk is Installed successfully.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.
For Ubuntu:

Step 1: There are many JDK’s developed by different companies. The most frequently used
JDK is Oracle JDK. Click here to visit the official website of Oracle Java SE (Standard Edition).
Click on “JDK Download”.
Step 2: Find the compatible version for your PC and click on the link. Accept the permission and
click download. Here I am using a .deb file.
Step 3: Open terminal (ctrl+Alt+T). Navigate to the downloaded file. In my case: “cd
Downloads/”.
Step 4: Execute “sudo dpkg -i file name” and give system password”.
Step 5: Execute “sudo update-alternatives --install /usr/bin/java java
/usr/lib/jvm/folder_name/bin/java 1”. (In my case folder name is jdk-16.0.1)
Step 6: Execute “sudo update-alternatives --install /usr/bin/javac javac
/usr/lib/jvm/folder_name/bin/javac 1” (In my case folder name is jdk-16.0.1)
Step 7: Execute “java --version” command to see the installed java version.
Step 8: Get the path of your java file using the “sudo update-alternatives --config java”
command which will give the location of the java file.
Step 9: To create home environment variables, execute “sudo gedit /etc/environment” to open
a file.
Step 10: In the last line type ‘JAVA_HOME=”give the path of step 8 only till file name called
jdk-version number” ‘. (Example: JAVA_HOME=”/usr/lib/jvm/jdk-16.0.1”)
Step 11: Save the file and close.
[email protected]
1FSBWQC5AJ
Step 12: Execute “source /etc/environment” to refresh the environment.
Step 13: “echo $JAVA_HOME”. You will see the java file in the created environment.

Congratulations! Your Jdk is Installed successfully.

This file is meant for personal use by [email protected] only.


Sharing or publishing the contents in part or full is liable for legal action.

You might also like