Configure the JDK7 environment variable and ubuntujdk7 environment variable in ubuntu
Method/step
- 1
First, Baidu searches for jdk and selects the first website, which is Oracle Jdk. Click in
- 2
Click Download to Download the jdk for linux on the official website. Bytes
- 3
Create the target path folder of Java, which is placed under usr/lib/jvm. Perform the following operations on the terminal:
$ Sudo mkdir/usr/lib/jvm
Enter your password to complete the creation.
- 4
Decompress the downloaded jdk compressed file to the directory you created. Run the following command.
$ Sudo tar-C/usr/lib/jvm-xzf jdk-7u55-linux-x64.tar.gz
Put your jdk file under your home page. Here I put it"Download"In the previous directory
- 5
Check whether the jdk file is correctly installed in the folder you created, and view the file
- 6
Check whether java is available on the local machine. The following command is used here:
$ Sudo update-alternatives -- list java
If an error is displayed in the graph and java is not available in the system, perform the following steps:
- 7
Environment variable configuration 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 whether the configuration is successful: java-version
Information is configured successfully!
END
Notes
Other methods are available for jdk configuration.
If you think it's good, just give it a compliment.