What path is specified for JAVA_HOME on Mac OS?

When an application or plug-in determines that the JAVA_HOME variable points to my JDK, which export should be specified in my .bash_profile?

+3
source share
3 answers

Go to: /System/Library/Frameworks/JavaVM.Framework/Versions/

Then select an alias for the version or "CurrentJDK".

export JAVA_HOME = / System / Library / Frameworks / JavaVM.Framework / Versions / CurrentJDK / Home

then add $ JAVA_HOME to your PATH.

+4
source

JAVA_HOME - java_home(1) (. http://developer.apple.com/library/mac/#qa/qa1170/_index.html). , :

export JAVA_HOME=$(/usr/libexec/java_home)
+8

I agree with Valko Sipuli.

I use Mac OS Yosemite and

JAVA_HOME = $ (/ usr / libexec / java_home)

did the trick to run ant.

0
source

Source: https://habr.com/ru/post/1778375/


All Articles