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: 18.104.22.168, 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.