Installation and management of multiple versions of JDK 2.1 mac

Source: Internet
Author: User

JDK8 has been installed before, installation path:/library/java/javavirtualmachines/jdk1.8.0_144.jdk

now install JDK10, after downloading, double-click the DMG file until the installation is complete, install the path: /LIBRARY/JAVA/JAVAVIRTUALMACHINES/JDK-10.0.1.JDK

After the installation is complete, the default JDK is already 10, so if you don't want to switch later, you can do so. Otherwise, perform the following steps.

I. Configuring Environment variables

1 sudo vi/etc/profile2 Add the following two lines:3 export java_8_home=/library/java/ javavirtualmachines/jdk1.8.0_144.jdk/contents/Home4 Export java_10_home=/library/java/ javavirtualmachines/jdk-10.0.1.jdk/contents/Home56 Note: no Java_home specified

Second, dynamically set the command to specify Java_home

1 alias jdk8= ' export java_home= $JAVA _8_home '2 alias jdk10= ' export java_home= $JAVA _10_home '

Third, perform the command switch

Execute JDK8 at terminal, switch to Java8 now, execute jdk10, switch to JAVA10.

Installation and management of multiple versions of JDK 2.1 mac

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.