我正在编译android系统源并遇到问题。
You are attempting to build with the incorrect version of java.
Your version is: java version "1.8.0_45".
The correct version is: Java SE 1.6.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
我打开终端试图查看我的java版本。
QuinnChens-MacBook-Pro:Android4.4 Quinn$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
QuinnChens-MacBook-Pro:Android4.4 Quinn$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
# Mac JDK 6
export JAVA_6_HOME=$(/usr/libexec/java_home -v 1.6 )
# Mac JDK 8
export JAVA_8_HOME=$(/usr/libexec/java_home -v 1.8 )
#alias dymatically switch JDK
alias jdk6="export JAVA_HOME=$JAVA_6_HOME"
alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
QuinnChens-MacBook-Pro:Android4.4 Quinn$ source ~/.profile
QuinnChens-MacBook-Pro:Android4.4 Quinn$ jdk6
QuinnChens-MacBook-Pro:Android4.4 Quinn$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
QuinnChens-MacBook-Pro:Android4.4 Quinn$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
You are attempting to build with the incorrect version of java.
Your version is: java version "1.8.0_45".
The correct version is: Java SE 1.6.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
如何在Mac中切换JDK版本?我使用的方式是否正确?
为什么" / usr / libexec / java_home"不改变?