Java Jdk - Installing
For other distros (Fedora, Arch, etc.), use your package manager ( dnf , pacman , etc.) to install openjdk . Open a terminal (Command Prompt on Windows, Terminal on Mac/Linux) and run:
javac HelloWorld.java # creates HelloWorld.class java HelloWorld # runs the program Expected output:
| Vendor | Best For | |--------|-----------| | | Enterprise, long-term support (LTS) | | OpenJDK | Open-source purists | | Amazon Corretto | AWS users, free LTS | | Eclipse Adoptium (Eclipse Temurin) | General development (my recommendation) | installing java jdk
Happy coding! ☕
# Update your package list sudo apt update sudo apt install default-jdk Verify installation java --version For other distros (Fedora, Arch, etc
java --version You should see something like:
public class HelloWorld public static void main(String[] args) System.out.println("Hello, Java!"); Create a file called HelloWorld
javac --version If you see version numbers for both, congratulations — you're ready to write Java! Create a file called HelloWorld.java :