source ~/.bashrc curl -s "https://get.sdkman.io" | bash sdk install java 17.0.9-tem sdk use java 17.0.9-tem 8. Setting JAVA_HOME Correctly Even if you only need the JRE, many applications check JAVA_HOME . Point it to the JRE installation directory.
which java # or readlink -f $(which java) Linux allows multiple JREs side-by-side. Use update-alternatives (Debian/Ubuntu) or manually set JAVA_HOME . Using update-alternatives (Debian/Ubuntu) # List available Java runtimes sudo update-alternatives --config java Manually register a new JRE sudo update-alternatives --install /usr/bin/java java /opt/jre-17/bin/java 1700 Manual JRE Switching (any distro) Set environment variables per user in ~/.bashrc or ~/.profile :
java -version Example output (OpenJDK 11):
A: Absolutely. Most cloud providers and enterprises use OpenJDK-based JREs.
© Bản quyền thuộc về TSD CO.,LTD. All rights reserved.