Ubuntu Configuration Java Environment

Source: Internet
Author: User

The Ubuntu system does not have a Java environment installed by default and is not installed when running Javac:

$ javacthe Program ' Javac ' can is found in the following packages: * DEFAULT-JDK * ECJ * GCJ-5-JDK * openjdk-8-jdk-headles S * GCJ-4.8-JDK * GCJ-4.9-JDK * openjdk-9-jdk-headlesstry:sudo apt install <selected package>

Open Oracle website, java

Http://www.oracle.com/technetwork/java/javase/downloads/index.html

Depending on the system selection version, select jdk-8u144-linux-x64.tar.gz(Linux x64 176.92 MB) to download it, then unzip the installation, install it here to/opt/ Under the Jdk-8 directory

Cd/opt/mkdir jdk1.8.0_144cd jdk1.8.0_144/mv/home/muti/downloads/jdk-8u144-linux-x64.tar.gz  . tar-zxvf jdk-8u144-linux-x64.tar.gz MV jdk1.8.0_144/*.

Then create a new Java environment variable in/etc/profile.

Vim/etc/profile

Fill in the content as follows

Export Java_home=/opt/jdk1.8.0_144export jre_home= $JAVA _home/jreexport classpath=.: $CLASSPATH: $JAVA _home/lib: $JRE _home/libexport path= $PATH: $JAVA _home/bin: $JRE _home/binexport java_home=/usr/jdk1.8.0_144export JRE_HOME= $JAVA _ Home/jreexport classpath=.: $CLASSPATH: $JAVA _home/lib: $JRE _home/libexport path= $PATH: $JAVA _home/bin: $JRE _home/bin

Effective immediately

Source/etc/profile

Check that the installation is correct

Java-version

Output

# Java-versionjava Version "1.8.0_144" Java (tm) SE Runtime Environment (build 1.8.0_144-b01) Java HotSpot (tm) 64-bit Server VM (build 25.144-b01, Mixed mode)

  

Ubuntu Configuration Java Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.