Linux under JDK installation

Source: Internet
Author: User

1. Log in to Linux and switch to the root user

Su Root gets root user rights, the current working directory is unchanged (requires root password)
Or
Sudo-i does not require the root password to switch directly to root (requires the current user password)

2. Create the Java installation directory in the USR directory

Cd/usr
mkdir Java

3. Copy the jdk-8u60-linux-x64.tar.gz to the Java directory

cp/mnt/hgfs/linux/jdk-8u60-linux-x64.tar.gz/usr/java/

4. Unzip the JDK to the current directory

TAR-ZXVF jdk-8u60-linux-x64.tar.gz


Get folder jdk1.8.0_60


5. Installation completed for him to create a link to save the directory length


(I don't use this step)
Ln-s/usr/java/jdk1.8.0_60//USR/JDK

6. Edit the configuration file, configure environment variables

Vim/etc/profile


Add the following: Java_home according to the actual directory to

Export java_home=/usr/local/java/jdk/jdk1.8.0_171/
Export JRE_HOME=/USR/LOCAL/JAVA/JDK/JDK1.8.0_171//JRE
Export path= $PATH: $JAVA _home/bin: $JRE _home/bin
Export classpath= $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar

7. Restart the machine or execute the command: Source/etc/profile

sudo shutdown-r now

8. View installation Status

Java-version

Java Version "1.8.0_60"
Java (TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot (TM) Client VM (build 25.60-b23, Mixed mode)

error messages that may appear:

BASH:./java:cannot Execute binary file


This error can occur because a 64-bit JDK is installed on a 32-bit operating system,
See if the JDK version and Linux version are the same number of bits.
To see if your Ubuntu installation is a 32-bit or 64-bit system:
sudo uname--m
i686//indicates 32-bit
x86_64//indicates 64-bit

Linux under JDK installation

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.