Turn: Ubuntu 18.04 LTS installation java10 (JDK) and problem description

Source: Internet
Author: User

Original address: Ubuntu 18.04 LTS Installation java10 and problem description

1. Download the appropriate installation package, such as jdk-10.0.1_linux-x64_bin.tar.gz. :

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

2. Unzip the file, the specific file name needs to refer to the actual downloaded version.

tar -zxvf jdk-10.0.1_linux-x64_bin.tar.gz

3. Move to the Library directory of the system.

sudo mv jdk-10.0.1 /usr/lib/

USR is the UNIX system resource abbreviation. In each library directory,/lib are kernel-level,/usr/lib are system-level, and/usr/local/lib are user-level.

So/usr/lib and/usr/local/lib can be placed in the JDK, it is recommended to place in/usr/lib.

Some tutorials Add a JDK directory on top of jdk-10.0.1, but be sure to match the environment variable path set below.

4. Setting Environment variables

Modify the global configuration file for all users:

or modify the current user profile to act on the current user only:

Java because most users need to use, it is recommended to modify/etc/profile. Add the following to the file

    1. Export java_home=/usr/lib/jdk-10.0.1
    2. export classpath=.:${java_home}/lib
    3. export path=.:${java_home}/bin:$PATH

Note that the actual content of the path needs to be determined based on the version and path of the previous step. Jre_home does not need to be configured in JAVA10 because the downloaded files no longer have the JRE directory, and the Java executable file is also archived in the bin directory.

Make the modified configuration effective immediately:

source /etc/profile

Or

source ~/.bashrc

The source command takes effect only at the current session, and requires a system restart if it is required to be globally active

5. Check

java -version

Normal should show:

Java version "10.0.1" 2018-04-17
Java (TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot (TM) 64-bit Server VM 18.3 (build 10.0.1+10, Mixed mode)

Turn: Ubuntu 18.04 LTS installation java10 (JDK) and problem description

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.