install JDK Windows, JAVA_HOME, set PATH for Java, VS Code Java setup, IntelliJ Java setup, first Java program, javac java commands, java not recognized fix, Tamil Technicians Java course,

Install JDK + VS Code/IntelliJ Setup+ Your First Java Program (Windows)

Install JDK + VS Code/IntelliJ Setup + First Java Program (Windows) | Tamil Technicians
Tamil Technicians
Java Course • Zero to Hero
Lesson 3 • Setup

Install JDK + VS Code/IntelliJ Setup
+ Your First Java Program (Windows)

If you are a beginner, the biggest confusion is: “Java install panniten… ஆனா terminal-la java / javac work ஆகல!” Don’t worry. This guide will help you install JDK properly, set JAVA_HOME and PATH, setup VS Code or IntelliJ IDEA, and run your first program successfully.

Level: Beginner OS: Windows 10/11 Editors: VS Code + IntelliJ Includes: Troubleshooting

1) Before you start (What you need)

Checklist

Before installing, keep these ready:

  • Windows 10/11 PC (Admin access preferred)
  • Stable internet connection
  • One code editor: VS Code (lightweight) or IntelliJ IDEA (best for Java)
  • Basic folder like: C:\java-projects for your practice files
Beginner recommendation: If your PC is normal (4GB–8GB RAM) → start with VS Code. If you want full professional Java experience → IntelliJ IDEA Community Edition.

Also remember: If you want to write Java programs, you must install JDK (Java Development Kit). Installing only “JRE” is not enough for compiling your code.

2) Download & Install JDK (Windows)

Step-by-step

There are many JDK distributions (Oracle JDK, OpenJDK builds). For beginners, choose a trusted one and stick to it. Common safe options:

  • Oracle JDK (official)
  • Eclipse Temurin (Adoptium) (popular OpenJDK build)
  • Microsoft Build of OpenJDK
Important: Always download JDK from official sources only. Avoid random sites.

Installation steps (simple):

  1. Download the JDK installer for Windows (x64).
  2. Run the installer → Next → Next.
  3. Choose install folder (default is OK). Example: C:\Program Files\Java\jdk-21
  4. Finish installation.

After install, we will verify using terminal and then set environment variables if needed.

3) Verify Java Installation (Most Important Step)

Must do

Open Command Prompt or PowerShell and run:

java -version
javac -version

If both show versions, your JDK is installed correctly and your PATH is already set. If you see an error like not recognized as an internal or external command, you must set PATH.

Expected output example: You should see something like: openjdk version “21.0.x” and javac 21.0.x

4) Set JAVA_HOME (Windows)

Environment variable

Some tools (Gradle, Maven, IDEs) use JAVA_HOME to find your JDK. Setting it correctly avoids many future issues.

Steps:

  1. Search in Windows: Edit the system environment variables
  2. Click: Environment Variables…
  3. Under System variables → Click New
  4. Variable name: JAVA_HOME
  5. Variable value: Your JDK path Example: C:\Program Files\Java\jdk-21
  6. Click OK → OK.
Don’t set JAVA_HOME to “bin” folder.
Correct: C:\Program Files\Java\jdk-21
Wrong: C:\Program Files\Java\jdk-21\bin

5) Set PATH (Fix: ‘java is not recognized’)

Troubleshooting

PATH tells Windows where to find commands like java and javac. If PATH is missing, terminal cannot find them.

Steps:

  1. Open: Edit the system environment variables
  2. Click: Environment Variables
  3. Under System variables → select Path → Edit
  4. Click New and add: %JAVA_HOME%\bin
  5. OK → OK → Restart terminal (very important)
Best practice: Add %JAVA_HOME%\bin instead of hard-coding the JDK path. Later if you update JDK, just update JAVA_HOME.

Now re-check:

java -version
javac -version

6) VS Code Setup for Java

Beginner-friendly

VS Code is lightweight and great for learning. To code Java easily, you should install the Java extensions.

Step-by-step:

  1. Install VS Code (if not installed).
  2. Open VS Code → Extensions (Ctrl+Shift+X).
  3. Search and install: Extension Pack for Java.
  4. Optional but useful: Code Runner (for quick runs).
  5. Restart VS Code.
How to run Java in VS Code (2 ways):
1) Use the Run button (after extension installs)
2) Or compile/run in terminal using javac and java

Once the Java extension is installed, VS Code will detect your JDK automatically (if JAVA_HOME / PATH is correct). If it doesn’t detect, reopen VS Code after setting variables.

7) IntelliJ IDEA Setup (Community Edition)

Best for Java

IntelliJ IDEA is considered one of the best IDEs for Java development. Even the free Community Edition is powerful for learning and projects.

Create your first Java project:

  1. Install IntelliJ IDEA Community Edition.
  2. Open IntelliJ → New Project.
  3. Select Java.
  4. Choose your JDK (it will show installed JDK; else browse and select JDK folder).
  5. Project name: JavaBasics (example)
  6. Finish → Create a class → Run.
Tip: IntelliJ can automatically compile and run your code without manual terminal commands. But you should still learn javac and java at least once.

8) Your First Java Program (HelloWorld)

Hands-on

Let’s create the classic first program. Create a folder: C:\java-projects\lesson3 and create a file named: HelloWorld.java

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, Java! ✅ Setup successful.");
    }
}

Compile and Run using Terminal:

cd C:\java-projects\lesson3
javac HelloWorld.java
java HelloWorld
If you see: Hello, Java! ✅ Setup successful. Congratulations! Your Java setup is perfect.

Now try changing the message and run again. This is how you build confidence. Always type the code yourself and run it.

9) Common Errors & Fixes (Beginner)

Troubleshoot

Error 1: java is not recognized…

Fix: Set PATH correctly and restart terminal. Verify using:

where java
where javac
java -version
javac -version

Error 2: Could not find or load main class

Fix: Ensure you are in the correct folder and you used correct class name. Run without .class.

Error 3: class HelloWorld is public, should be declared in a file named HelloWorld.java

Fix: File name must match the public class name exactly.

Error 4: VS Code shows Java extension issues

Fix: Install “Extension Pack for Java”, restart VS Code, ensure JDK is installed and detected.

Most important: After changing environment variables, restart terminal and sometimes restart VS Code/IntelliJ. Old terminals won’t pick up new PATH.

10) Best Practices (Make your learning smooth)

Pro tips
  • Create a dedicated folder for practice: C:\java-projects
  • One lesson = one folder (clean learning)
  • Always match file name and class name
  • Use LTS JDK versions
  • Learn terminal compile/run at least once (strong foundation)
  • Write code daily (30–45 minutes)
Next lesson: Java Program Structure (class, main, methods) explained deeply.

11) Practice Tasks (Do today)

Exercises
  • Run java -version and take a screenshot for your notes.
  • Create 3 programs: HelloWorld, AboutMe, MyGoal.
  • Compile and run all programs using terminal commands.
  • Change file name wrongly and see the error. Fix it again.
  • Try both VS Code and IntelliJ once (choose one for daily use).
// AboutMe.java (Try this)
public class AboutMe {
    public static void main(String[] args) {
        System.out.println("Name: ______");
        System.out.println("City: ______");
        System.out.println("Goal: Java Zero to Hero!");
    }
}

Recommended Internal Links (SEO)

Keep users learning
© Tamil Technicians • Java Course (Zero to Hero) • Support

Buy link :


Contact

link Click Here >>>


Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top