Installing Java 17 May 2026
Add this to your ~/.bashrc , ~/.zshrc , or ~/.profile file:
javac Test.java java Test Expected output: installing java 17
sudo apt update sudo apt install openjdk-17-jdk Many Java tools (Maven, Gradle, Tomcat) rely on the JAVA_HOME variable. The Windows .msi installer often sets this automatically. Check using: Add this to your ~/
Remember: If you ever need to switch between Java versions (e.g., Java 11 for an older project), tools like jEnv (macOS/Linux) or the "Java Version Manager" for Windows can help. Add this to your ~/.bashrc