w1coding.comAll tutorials

Java Environment Setup

Java lessons
  1. Environment Setup
  2. Introduction
  3. Variables
  4. Control
  5. Loops
  6. Arrays
  7. Methods
  8. OOP
  9. Contractors
  10. Inheritance
  11. Polymorphism
  12. Abtract
  13. Interfaces
  14. Constructors
  15. Static
  16. Exception
  17. Collections
  18. Lambda
  19. Streams
  20. Strings
  21. Date
  22. Interface
  23. Inheritance
  24. Polymorphism
  25. Exception
  26. File

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

  1. Install a JDK from a provider linked by Dev.java. Follow its platform-specific PATH instructions.
  2. Open a new terminal and run java --version and javac --version. Both commands should work.
  3. Create a project folder and save the example as Hello.java. The filename must match the public class name, including capitals.
  4. 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 Hello

Expected 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.