Cart
0
Installing Java 17 [verified] -
Add this to your ~/.bashrc , ~/.zshrc , or ~/.profile file:
javac Test.java java Test Expected output: installing java 17
export JAVA_HOME=$(/usr/libexec/java_home) # macOS only # OR for Linux: export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH Then reload: source ~/.bashrc Create a simple Java program to confirm everything works. Save the following as Test.java : Add this to your ~/
Compile and run: