Java development needs a JDK, which includes the Java compiler and runtime tools. Installing only a runtime is not enough to compile source files.
What you need
- A supported Java Development Kit
- An editor or Java IDE
- A terminal
Set up your environment
- Install a JDK from a provider linked by Dev.java. Follow its platform-specific PATH instructions.
- Open a new terminal and run
java --versionandjavac --version. Both commands should work. - Create a project folder and save the example as
Hello.java. The filename must match the public class name, including capitals. - Compile the source, then run the class name without the .class suffix.
Your first check
Save as Hello.java
public class Hello {
public static void main(String[] args) {
System.out.println("Hello from w1coding.com");
}
}Run or verify
javac Hello.java
java HelloExpected result: The console prints Hello from w1coding.com.
Common setup problems
- If java works but javac does not, verify that you installed a JDK and selected its bin directory.
- A class-not-found error often means the terminal is in the wrong folder or the class name does not match.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.