Skip to content

JAVA_HOME does not point to the JDK #3

@rainyear

Description

@rainyear

Android studio 要 >= JDK 1.7,升级之后,Cordova run 出错:

/Applications/ADT/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Applications/ADT/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Applications/ADT/sdk/tools/ant/build.xml:734: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre"

找半天没有找到解决方法,只好将环境变量 JAVA_HOME 先设置回 1.6,参考:
How To Set $JAVA_HOME Environment Variable On Mac OS X

# edit ~/.bash_profile && add or edit
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions