Thursday, 12 October 2017

macos - Where is Java Installed on Mac OS X?

itemprop="text">

I just downloaded Java 7u17 on Mac OS
10.7.5 from rel="noreferrer">here and then successfully installed it. In order to do
some JNI programming, I need to know where Java installed on my Mac.




I thought that inside the
/Library/Java/JavaVirtualMachines/ folder, there would be a
folder called 1.7.0.jdk or something, but then I found that the
folder is empty. This was confirmed by running ls
/Library/Java/JavaVirtualMachines/
in the Terminal. I've tried searching
for it to find out if it was installed somewhere else, but that doesn't seem to be
turning anything up.



Could someone please tell
me where Java is installed on my Mac?


class="post-text" itemprop="text">
class="normal">Answer



Use
/usr/libexec/java_home -v 1.8 command on a terminal shell to
figure out where is your java 1.8 home
directory



If you just want to find out the home
directory of your most recent version of java, omit the version. e.g.
/usr/libexec/java_home



No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...