简体   繁体   中英

cannot set JAVA_HOME on macosx

I am using OS X EL Capitan 10.11.

I set JAVA_Home in ~/.bashrc

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/"
export PATH=$JAVA_HOME/bin:$PATH

Seems like nothing worked even I closed and re-opened terminal. It still says

+======================================================================+
|      Error: JAVA_HOME is not set and Java could not be found         |
+----------------------------------------------------------------------+

I thought it was same like Linux but it looks like it is not. Is there anywhere else I should export JAVA_HOME?

从以下路径中引用Java可执行文件:

/usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java

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