Cài đặt máy tính của bạn
Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
English
Run Java on your own computer
- This playground is great for learning — but it runs on our server.
- For your own projects, it helps to set Java up on your computer.
- It takes about 15 minutes, and you only do it once.

English
Step 1 — Install the JDK
- To run Java you need a JDK (Java Development Kit) on your computer.
- A free, easy choice is Eclipse Temurin from adoptium.net — pick JDK 21.
- Download the installer for your system (Windows, macOS, or Linux) and run it.
English
Step 2 — Install VS Code
- VS Code (Visual Studio Code) is a free, popular code editor from Microsoft.
- Get it from code.visualstudio.com and install it.
- This is where you will write and run your code.
English
Step 3 — Add the Java extension
- Open VS Code and click the Extensions icon on the left.
- Search for Extension Pack for Java (the one by Microsoft) and click Install.
- It adds run buttons, colours, and helpful hints for Java.
English
Step 4 — Check it worked
- Open a terminal (in VS Code: Terminal → New Terminal) and type:
java --version
- You should see something like
openjdk 21. If you do, you are ready.
English
Step 5 — Run your first file
- In VS Code, make a new file called
Main.javaand type:
public class Main {
public static void main(String[] args) {
System.out.println("Hello from my own computer!");
}
}
- Press the ▶ Run button (top right) above the
mainmethod. - You just ran Java outside the browser.