Install jdk1.8 under Linux

Source: Internet
Author: User

Believe yards farmers absolutely can not resist the temptation of Linux system, also in the world of Linux, Java, the following I will share with you about my jdk1.8 installation process, new contact with the Linux children's shoes are completely in accordance with the commands I provided in the picture to install OH ~ ~

Tools/Materials
    • Jdk-8-linux-i586.gz
Method/Step
  1. 1

    The first step: Download the Linux environment jdk1.8, please go to the (official website) to download the JDK installation files;

    Since my Linux is 32 bits, I download the jdk-8u25-linux-i586.tar.gz file.

    As shown in the following:

  2. 2

    Step Two: Create a new/usr/java folder, place the jdk-8u25-linux-i586.tar.gz in the folder, and switch the working directory to the/usr/java directory. As shown in the following:

    command to use: TAR-ZXVF jdk-8u60-linux-x64.tar.gz

  3. 3

    Step three: Through the above steps, jdk1.8 has been all installed, please remember the steps oh. As shown in the following:

  4. 4

    Fourth Step: Configure the Environment variables: ①, edit the profile with Vim/etc/profile, as shown in the following 1 figure: ②, add the following at the bottom of the/etc/profile:

    Java_home=/usr/java/jdk1.8.0_25

    Path= $JAVA _home/bin: $PATH

    Classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar

    Export PATH java_home CLASSPATH

    As shown in the 2 figure below:

  5. 5

    Fifth step: Finally use Source/etc/profile to make the profile file effective immediately. As shown in the following:

  6. 6

    Sixth step: Command Test,

    ①, command not found error is not present with JAVAC commands

    ②, using Java-version, appears as Java version "1.8.0_25"

    ③, Echo $JAVA _home, Echo $CLASSPATH, echo $PATH, see if your configuration is correct.

    END
  7. ————— "Uninstalling the JDK" —————————————————————————————————

#rpm-Q JDK

#rpm-E--nodeps jdk-1.6.0_45-fcs.i586

Reconfirm: #rpm-Q JDK user confirms that the uninstallation was successful

Note the error messages that may occur:



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

    • Note that the path in the configuration, it is necessary to put $java_home/bin in front, or use the Java command, the system will find the previous Java, do not look down. In this way, the JAVA executable file run directory is not $java_home/bin, and in other directories, will cause a lot of problems.

Install jdk1.8 under Linux

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.