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