To future me, here is the way to set JAVA_HOME

To future me, here is the way to set JAVA_HOME

Programming Jul 14, 2023

Million times come across Java software and it needs some weird things called JAVA_HOME

How to find

Assume already install java , you can check it by java -version

Then trace the link back to the real location:

readlink -f $(which javac)

This will give you back something like

/usr/lib/jvm/java-11-openjdk-amd64/bin/javac

Then the Java home is the parent path of bin

JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/

Hope this save you sometimes !

Tags

TeamCMD

We are CODEMONDAY team and provide a variety of content about Business , technology, and Programming. Let's enjoy it with us.