This document provides instructions for installing Java and setting the Java home and path on Ubuntu. It describes using apt-get to install the Java Runtime Environment (JRE) or Java Development Kit (JDK) and editing the .bashrc file to set the JAVA_HOME and PATH variables to specify where Java is located.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
21 views1 page
Installing JAVA
This document provides instructions for installing Java and setting the Java home and path on Ubuntu. It describes using apt-get to install the Java Runtime Environment (JRE) or Java Development Kit (JDK) and editing the .bashrc file to set the JAVA_HOME and PATH variables to specify where Java is located.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Installing default JRE/JDK on Ubuntu
Installing Java with apt-get is easy.
1. First, update the package index: sudo apt-get update 2. Then, check if Java is not already installed: java -version 3. If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command: sudo apt-get install default-jre This will install the Java Runtime Environment (JRE). 4. If you instead need the Java Development Kit (JDK), which is usually needed to compile Java applications (for example Apache Ant, Apache Maven, Eclipse and Intel IDEA execute the following command ) sudo apt-get install default-jdk
Step to setup Java Path
The following are the step to set the Java Home and path: 1. Launch the Terminal and do sudo su. 2. Identify where Java is stored on your machine by using the command, which java 3. Now to set the JAVA_HOME globally, we edit the bash .bashrc file. 4. At the end of the file type the following, one line at a time, i. JAVA_HOME=/usr/lib/jvm/default-java/bin ii. export JAVA_HOME iii. PATH=$PATH:$JAVA_HOME iv. export PATH 5. Close the Ternimal and open it again. 6. Run the following command echo $JAVA_HOME You will now get the new path that you have set. 7. Type the following command to check the java version java -version