Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is java installed on Mac. I can't find it

I have successfully installed java. When I type in the terminal:

java -version

I get: java version "14.0.1" 2020-04-14. But I don't know where it is installed.

When I type :

echo $(/usr/libexec/java_home)

to get the path it shows me: /Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home but in the folder Library isn't the folder Java : -bash: cd: Java: No such file or directory*

like image 395
zazagg Avatar asked Feb 20 '26 09:02

zazagg


2 Answers

Execute the following command on Mac Terminal:

/usr/libexec/java_home -V

It will show you all the versions of JDK installed in your Mac.

Now, let's say it shows you paths like as given below:

/Library/Java/JavaVirtualMachines/jdk-14.0.1.jdk/Contents/Home

Execute the following command:

cd /Library/Java/JavaVirtualMachines/
ls
like image 67
Arvind Kumar Avinash Avatar answered Feb 22 '26 22:02

Arvind Kumar Avinash


Simply, type java -verbose in terminal, you will get the java installation location in the first line.

like image 38
Kumar Anil Chaurasiya Avatar answered Feb 22 '26 21:02

Kumar Anil Chaurasiya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!