Java Tutorial » Environment

Chapter 2 — Environment Setup

Set up a Java development environment: online try options, local setup and editors.

1. Try It Online

Online Java Compilers & IDEs

Quick options to write and run Java without installing anything:

  • JDoodle — Simple online compile & run: JDoodle
  • Repl.it — Collaborative and persistent editor: Replit
  • OnlineGDB — Online debugger & editor supporting Java: OnlineGDB
  • Ideone — Quick run: Ideone

Notes: Online tools are great for quick testing, learning and sharing code. They are not recommended for building production apps, working with complex dependencies, or learning tooling like Maven/Gradle.

Sample — Quick Hello World

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello from online Java!");
    }
}
2. Local Setup

Local Environment Setup (Windows)

For local development on Windows, install a JDK (Java Development Kit) and configure your PATH.

1) Install a JDK

Recommended: Temurin (Eclipse Adoptium) or OpenJDK builds. Download from:

2) Set JAVA_HOME and PATH (PowerShell)

  1. Install JDK (example default install path: C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot).
  2. Open PowerShell as Administrator and set environment variables (temporary for session):
$env:JAVA_HOME = 'C:\Program Files\Eclipse Adoptium\jdk-17.0.7.7-hotspot'
$env:PATH = $env:JAVA_HOME + '\\bin;' + $env:PATH
javac -version
java -version

To make variables permanent, use System Properties or set in the registry via System -> Advanced -> Environment Variables.

3) Compile & Run

Open a terminal (PowerShell) in the directory where you saved your local example file (e.g., HelloWorld.java) and execute:

javac HelloWorld.java
java HelloWorld

If you see version numbers, your JDK is installed correctly. If not, re-check PATH and JAVA_HOME.

3. Editors

Popular Java Editors & IDEs

Pick according to your goals — quick editing vs enterprise development:

  • IntelliJ IDEA — Best productivity, deep Java support. Community Edition is free and great for most learners and developers.
  • Eclipse — Extensible and widely used, great for large enterprise codebases.
  • Visual Studio Code — Lightweight. Install the Java Extension Pack for debugging, Maven/Gradle, and code navigation.
  • NetBeans — Full-featured, good for beginners and educational projects.

Tooling Tips

  • Use an IDE for Java when working with multiple files, debugging, or build tools (Maven/Gradle).
  • VS Code + Java Extension Pack is great for smaller or scripting-style workflows.
⬅️ Previous: Overview Next: Basic Syntax ➡️