Linux, manually switch the JDK

Source: Internet
Author: User

1. First install the custom JDK directory into alternatives

[Email PROTECTED]:~/SRCANDROID/SRC4. 4. 4_r1$ sudo update-alternatives--install/usr/bin/java java/home/seven/documents/android/jdk1. 6 700
[Email protected]:~/srcandroid/src4.4.4_r1$ sudo update-alternatives--install/usr/bin/javac javac/home/seven/ Documents/android/jdk1.6.0_45/bin/javac 700
[Email protected]:~/srcandroid/src4.4.4_r1$ sudo update-alternatives--install/usr/bin/jar jar/home/seven/documents /android/jdk1.6.0_45/bin/jar 700
[Email protected]:~/srcandroid/src4.4.4_r1$ sudo update-alternatives--install/usr/bin/javah javah/home/seven/ Documents/android/jdk1.6.0_45/bin/javah 700

2. Select

[Email PROTECTED]:~/SRCANDROID/SRC4.4.4_r1$ sudo update-alternatives--config java//can be javac, Javah, Jar[sudo] Password forSeven:there is2Choices forThe Alternative Java (providing/usr/bin/Java). Selection Path Priority Status------------------------------------------------------------0/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java1071Auto Mode*1/home/seven/documents/android/jdk1.6.0_45/bin/java theManual Mode2/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java1071Manual Modepress<enter> to keep the choice[*], or type selection number:

3. Verification

[Email PROTECTED]:~/SRCANDROID/SRC4. 4. 4_r1$ java-"1.6.0_45"1.6. 0_45-   20.45-b01, mixed mode) [email protected]:~/SRCANDROID/SRC4. 4

Manually switch the JDK 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.