Detailed steps for installing the JDK manually by Ubuntu _linux

Source: Internet
Author: User

First go to Oracle download Linux under the JDK compression package, I downloaded the jdk-7u4-linux-i586.tar.gz file, the next good after the direct decompression

STEP1:
# Copy the Unpacked Jdk1.7.0_04 folder to the/USR/LIB/JVM directory with the highest privileges
sudo cp-r ~/jdk1.7.0_04//usr/lib/jvm/

STEP2:
# Configure Environment variables

Copy Code code as follows:

sudo gedit ~/.profile

At the end add:
Copy Code code as follows:

Export Java_home=/usr/lib/jvm/jdk1.7.0_04

Then save the shutdown, using the source update
$ source ~/.profile

To view the value of a java_home using the ENV command
$ env
If java_home=/usr/lib/jvm/jdk1.7.0_04, this indicates a successful configuration.

STEP3:

Copy Code code as follows:

# Modify the default JDK for the system.
$ sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/jdk1.7.0_04/bin/java 300

It would be nice to enter the numbers before the Sun jdk.

Copy Code code as follows:

$ sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/jdk1.7.0_04/bin/javac 300

$ sudo update-alternatives--config java
$ sudo update-alternatives--config javac


STEP4:
Then enter Java-version, see the following information, it is changed to the Sun JDK:
Java Version "1.7.0_04"
Java (TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot (TM) Server VM (build 23.0-b21, Mixed mode)


Problems that may exist:

1. Hint missing libjli.so Unable to start ..., encounter this problem is you download the JAVAJDK compression package is incomplete, or your decompression mode is not caused, directly to the current path, and then copy to the directory you need, JDK installation directory can be arbitrarily selected, For example, you can put it in the home directory,
libjli.so file in: ~/jdk1.7.0_07/jre/lib/i386/jli/libjli.so

2. You may not be able to configure success, you need to uninstall the previously installed OPENJDK, you can remove the command line

3. Different versions of the JDK, version number as modified on the

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.