Which shell command returns Java's home path?
0
votes
1
answer
969
views
I'm aware of the *which* command but when I run it on Java, I get the following path:
$ which java
/bin/java
What I'm looking for, I think, is the Java path I get when I run the following Maven command:
$ mvn -version
Apache Maven 3.6.3
Java version: 11.0.14.1, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.13.0-1021-aws", arch: "amd64", family: "unix"
Isn't the latter (/usr/lib/jvm/java-11-openjdk-amd64) the correct Java home path?
If so, which command would directly return it?
Running the *java version* command doesn't return any paths.
Asked by Omar Shazly
(3 rep)
Apr 13, 2022, 02:23 PM
Last activity: Apr 13, 2022, 02:35 PM
Last activity: Apr 13, 2022, 02:35 PM