Mac OS X 10.10.2 Yosemite JDK environment variable configuration

Source: Internet
Author: User

My Mac system version is OS X 10.10.2 Yosemite, which installs JDK 1.7 for Android development with Eclipse, but if you want to use the IntelliJ IDE for Android, you need to install jdk1.6, So in accordance with the official guidelines installed jdk1.6, but run the java-version command, the actual system JDK version is still 1.7, so on the internet for half a day, finally found a way to modify the default JDK version of the system,

Original link: http://www.cnblogs.com/havenshen/p/3490448.html

Go to command line

CD ~touch. Bash_profilevi. Bash_profile

PS: If there is no. bash_profile file in the home directory, create a new

Enter the contents of the JDK variable configuration:

Export java_home=/library/java/javavirtualmachines/jdk1.7.0_45.jdk/contents/home #jdk安装路径   Export Path= $JAVA _ Home/bin: $PATH export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Input: Wq save.

To update a configuration file:

source. bash_profile

PS: The Java_home path here is the installation path of the installation package jdk1.7 downloaded from the Oracle official website, and from the official website Https://support.apple.com/kb/DL1572?locale=en_US Download the jdk1.6 default installation path is/System/library/java/javavirtualmachines/1.6.0.jdk/contents/home, according to the method above, put Java_ Home to the jdk1.6 path, you can do the system default JDK changed to 1.6.

But I also found that, in order to use the IntelliJ IDE for Android development, actually do not have to modify the default JDK version of the system, just to import the project in the IntelliJ IDE, select the jdk1.6 installation path, you can use a different version of the JDK, I hope I can help the people who are confused with me at first.

Mac OS X 10.10.2 Yosemite JDK environment variable configuration

Related Article

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.