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.

コメント

このブログの人気の投稿

モノレポ vs マルチレポ 徹底比較

KiCadでPCB作成入門

ESP32 Wi-Fi 接続ガイド