How to recover /usr/libexec/java_home executable on Mac OS X 10.8.5?

6

Today I accidentally delete the /usr/libexec/java_home executable on my Mac OS X 10.8.5 (Mountain Lion) while trying to install latest JDK. Then, I realized that homebrew (package manager) and some other apps needs that binary.

Where can I find or recover that file?

edigu

Posted 2015-02-18T18:48:28.913

Reputation: 223

Answers

6

I found the solution. It was just a symlink and original file was still alive in this directory:

/System/Library/Frameworks/JavaVM.framework/

So, simply put back the symlink using the following command:

sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home /usr/libexec/.

Update: The System/Library/Frameworks directory holds the framework files which provide interfaces needed to write software for Mac. You can learn more about this directory on official OS X Frameworks documentation.

edigu

Posted 2015-02-18T18:48:28.913

Reputation: 223

What's the System/Library/Frameworks folder do anyway? – Pacerier – 2017-11-01T20:32:43.193

Hey @Pacerier, I have updated the answer and added a link for the docs. – edigu – 2017-11-02T14:14:59.867

1For me it is Versions/A, no idea why. There is no Versions/Current. – trss – 2018-07-04T09:26:40.033