To future me, here is the way to set JAVA_HOME

tanut aran
Jan 31, 2022

--

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 !

--

--

tanut aran
tanut aran

Written by tanut aran

Co-founder and Coder at work !

No responses yet