Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (2.6k points)

I just downloaded Java 7u17 on Mac OS 10.7.5 from 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?

1 Answer

0 votes
by (46k points)

To find out where your java 1.8 home directory is you can use:

/usr/libexec/java_home -v 1.8 

command on a terminal shell.

Or

If you only want to find out the home directory of your most recent version of java, eliminate the version. E.g.

 /usr/libexec/java_home

Related questions

0 votes
1 answer
asked Dec 20, 2020 in SQL by Appu (6.1k points)
0 votes
1 answer
asked Jul 10, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...