Error: JAVA_HOME is not set [How to Solve]

Error: JAVA_HOME is not set.

[[email protected] fe]# which java
/usr/bin/java
[[email protected] fe]# ll /usr/bin/java
lrwxrwxrwx 1 root root 22 12月 21  2020 /usr/bin/java -> /etc/alternatives/java
[[email protected] fe]# ll /etc/alternatives/java
lrwxrwxrwx 1 root root 76 12月 21  2020 /etc/alternatives/java -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.h5.ky10.aarch64/jre/bin/java


cat > /etc/profile.d/openjdk.sh <<'EOF'
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.h5.ky10.aarch64/jre/
export PATH=$PATH:$JAVA_HOME/bin
EOF

source /etc/profile

Similar Posts: