Ubuntukylin install sun jdk1.7

Source: Internet
Author: User

1. Download and decompress jdk1.7.0 _ 67, and put it in the/usr/local/lib/JVM directory.

Tar zxvf jdk1.7.0_67.tar.gz

Sudo MV jdk1.7.0 _ 67/usr/local/lib/JVM

2. Edit ~ /. Add the following content to the bashrc file.

The content after java_home is your custom JDK storage directory


Export java_home =/usr/local/lib/JVM/jdk1.7.0 _ 67

Export jre_home =$ {java_home}/JRE

Exportclasspath =.: $ {java_home}/lib: $ {jre_home}/lib

Export path =$ {java_home}/bin: $ path


3. Set the default JDK version

Sudo Update-alternatives -- install "/usr/bin/Java/" "Java" "/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/Java" 300


Sudo Update-alternatives -- install "/usr/bin/javac" "javac" "/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javac" 300


Sudo Update-alternatives -- install "/usr/bin/jar" "jar" "/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/jar" 300


Sudo Update-alternatives -- install "/usr/bin/javah" "javah" "/usr/local/lib/JVM/JDK 1.7.0 _ 67/bin/javah" 300


Sudo Update-alternatives -- install "/usr/bin/javap" "javap" "/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javap" 300


Sudo Update-alternatives -- install "/usr/bin/javaws" "javaws" "/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javaws" 300


Sudo Update-alternatives -- set Java/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/Java

Sudo Update-alternatives -- set javac/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javac

Sudo Update-alternatives -- set JAR/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/jar

Sudo Update-alternatives -- set javah/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javah

Sudo Update-alternatives -- set javap/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javap

Sudo Update-alternatives -- set javaws/usr/local/lib/JVM/jdk1.7.0 _ 67/bin/javaws


4. Check

Java-version

[Email protected]: ~ $ Java-version

Java version "1.7.0 _ 67"

Java (TM) se Runtime Environment (build 1.7.0 _ 67-b01)

Java hotspot (TM) 64-bit server VM (build 24.65-b04, mixed mode)


This article is from the "Linux Windows Security" blog, please be sure to keep this source http://3135888.blog.51cto.com/3125888/1547143

Ubuntukylin install sun jdk1.7

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.