The end goal is to understand my java environment on my machine.
And to have a clean install of only one java version.
By removing all the current versions and starting clean.
Perform the clean install using Homebrew.
Commands to find out which versions I am using/have and where they are located.
java -version
/usr/libexec/java_home -V
java_home /usr/libexec/java_home -V
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
/usr/libexec/java_home --help
/usr/libexec/java_home
Commands regarding environment variables.
printenv and env print the environment variables.
What I want to find out:
How to definitively
-
find all version of Java that I have on my computer.
-
where they are located.
-
how to remove them all
-
how to cleanly install only one version.
-
where environment variables are located for Java
-
and how they're used.
-
and what is Java_Home? Or java_home?
For environment variables:
Good info here (macOS/Linux) Environment Variables.
And in this Environment variables in Mac OS X Stackoverflow post.
JAVA_HOME:
JAVA_HOME is an operating system (OS) environment variable which can optionally be set after either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is installed. The JAVA_HOME environment variable points to the file system location where the JDK or JRE was installed.
Lots of info here Understanding Java From Command Line on OSX
Removing and/or installing:
macos removing multiple versions of Java internet search.
macos clean java install homebrew macos internet search.
removing all versions of java macos internet search.