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