How to set JAVA_HOME when installed OpenJDK with yum

Answer

  • export JAVA_HOME=$(readlink $(readlink $(which java)))

First which java returned the below path.

/usr/bin/java

Next command readlink $(which java) returned the below path.

/etc/alternatives/java

Last command readlink $(readlink $(which java)) returned the below path.

/usr/lib/jvm/java-9-openjdk-amd64/bin/java

And you can be assigned this result to environment variable.

Comments

Popular posts from this blog

Detect Bluetooth LE Device with BlueZ on RaspberryPi

What I did until many slimes spawn on slime chunk

Major Maven goals