Configuration of the Java Development environment under Linux (Ubuntu 16) (i)------JDK configuration

Source: Internet
Author: User

This paper introduces a general installation method, which can be installed by Linux system. This article takes the JAVA8 environment as an example to configure. 1.JDK downloads into the Java download page (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), Download the Java JDK and selectjdk-8u161-linux-i586.tar.gz"File, download to local. 2.JDK installation Because the operation under the Usr/lib directory requires administrator privileges, add sudo before the command
    • Confirm that there is a JVM folder under the/usr/lib/directory, and if you do not create a JVM folder with sudo permissions (go to that directory, sudo mkdir JVM)
    • Unzip the downloaded file into the directory (command: sudo tar zxvf./jdk-8u161-linux-i586.tar.gz-c/USR/LIB/JVM)
3. Environment path Configuration Open the environment path file: sudo vi ~/.profileAdd the following statement to the end of the text:
Export JAVA_HOME=/USR/LIB/JVM/JDK1. 8 . 0_161export jre_home=${java_home}/jreexport CLASSPATH=.:${java_home}/lib:${jre_home}/  Libexport PATH=${java_home}/bin: $PATH

SOURCE ~/.profile, update environment variable 4. Results test input java-version, if prompted for Java version information, the installation is successful5. Summary of Commands

sudo mkdir jvmsudo tar zxvf. /jdk-8u161-linux-i586.tar.gz   -c/usr/lib/~/. Profileexport java_home=/usr/lib/jvm/jdk1.  8. 0_161export jre_home=${java_home}/jreexport CLASSPATH=.:${java_home}/lib:${jre_home}/ libexport PATH=${java_home}/~/
6. Issues that may arise:(1) Program ' Java ' is included in the following packages
' Java ' is included in the following packages: default-JRE* gcj-4.9-jre-Headless* gcj-5-jre-Headless* openjdk-8-jre-Headless* gcj-4.8-jre-Headless* openjdk-9- jre-< selected packages >

Workaround: Manually set the system default JDK

In the terminal, enter the command in turn:
sudo update-alternatives--install/usr/bin/javac javac/usr/jvm/jdk1. 8  - sudo update-alternatives--config java

You can then enter Java-version to see the version information for the installed JDK.

The Question Reference blog: http://blog.csdn.net/vicky__rain/article/details/5353943

Configuration of the Java Development environment under Linux (Ubuntu 16) (i)------JDK configuration

Related Article

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.