简体   繁体   中英

Unable to switch to Java 1.6 on El Capitan

I'm running the following command to try to switch to Java 1.6

$export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)

But am getting the error

-bash: JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home: No such file or directory

Yet the directory in the error message does exist: 在此输入图像描述

你必须保留前面的美元符号( export而不是$export ):

export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM