Ubuntu method to install JDK environment variables Ubuntu configuration JDK steps

  
                

Ubuntu 14.04 long-term support has come out, and many users can't wait to install it. But there are still many users who don't know how to install JDK, and there are installations, I don't know how to configure environment variables. How to install JDK? What is the way Ubuntu configures JDK environment variables? Now let's talk about the way Ubuntu installs JDK environment variables by

The specific steps are as follows:

1. First, download jdk, choose the first one, the website is Oracle Jdk. Click to go to

2. Click Download to download the linux version of jdk from the official website. Choose your own operating system and 32 or 64-bit version, here I downloaded the 64-bit version of jdk-7u55-linux-x64.tar.gz

3, create a Java target path folder, here We put it under usr/lib/jvm. Under the terminal:

$ sudo mkdir /usr/lib/jvm

After entering your password to complete the creation

4, extract the jdk compressed file you downloaded to you Create the directory with the following command.

$ sudo tar -C /usr/lib/jvm -xzf jdk-7u55-linux-x64.tar.gz

Note that put your jdk file on your home page, Here I put it in the previous directory of "Download"

5. Check if the jdk file is correctly installed in the folder you created and view the file

6. View this Is there still java optional on the machine? The following command is used here

$ sudo update-alternatives --list java

If there is an error in the display graph, there is no java option in the system, we can perform the following steps

7. Configure environment variable command:

$sudo gedit ~/.bashrc

Add the following code:

export JAVA_HOME=/usr/lib/jvm/jdk1.7.0 _55

export JRE_HOME=${JAVA_HOME}/jre

export CLASSPATH=. :${JAVA_HOME}/lib:${JRE_HOME}/lib

export PATH=${JAVA_HOME}/bin:$PATH

8. Check if the configuration is successful: java -version

There is a successful configuration of the information as shown below!

The method of installing JDK environment variables in Ubuntu is introduced to you in detail. If you still don't know how to install JDK, please take a look at the above content. After reading it, you will know how to install and configure environment variables.

Copyright © Windows knowledge All Rights Reserved