Complete step-by-step guide to install Oracle JDK 17 LTS and set up Visual Studio Code for Java programming with all required extensions and configurations.
👉 https://www.oracle.com/java/technologies/downloads/
Default path (recommended):
C:\Program Files\Java\jdk-25
java -version
Expected output:
java version "25.x.x"
Java(TM) SE Runtime Environment
If this works → Oracle JDK is installed correctly ✔️
Type:
sysdm.cpl
Under System Variables → Click New
Variable name:
JAVA_HOME
Variable value:
C:\Program Files\Java\jdk-25.0.2
Add:
%JAVA_HOME%\bin
🔁 Close & reopen Command Prompt
Verify again:
javac -version
✔️ Compiler working
👉 https://code.visualstudio.com
During installation, check these boxes: ✔ Add to PATH ✔ Register Code as an editor
Extension Pack for Java
📦 Includes:
VS Code usually detects it automatically, but let’s be explicit.
Type:
Preferences: Open User Settings (JSON)
{
"java.jdt.ls.java.home": "C:\\Program Files\\Java\\jdk-25.0.2"
}
⚠️ Use double backslashes in Windows paths
Save the file
JavaPractice
Open it in VS Code
HelloWorld.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Oracle JDK + VS Code works!");
}
}
main()
ORjavac HelloWorld.java
java HelloWorld
🎉 Output:
Oracle JDK + VS Code works!
javac is not recognized✔ JAVA_HOME not set correctly ✔ PATH not updated ✔ Restart Command Prompt / VS Code