We use cookies to analyze site traffic and show personalized ads. You can accept all cookies or decline personalized advertising.
Learn more in our Privacy Policy.
Install and configure Java Development Kit for Selenium automation.
JAVA_HOME environment variable on your Windows machine.PATH so tools like Maven and IntelliJ can detect Java correctly.Before writing any Selenium test, your machine must be able to compile and run Java code. If Java or JAVA_HOME are not properly configured, you'll face weird errors in IDEs or test tools. This lab makes sure your environment on Windows is clean, stable, and ready for the rest of the course.
java, javac, and other Java commands from any folder in Command Prompt..exe, .msi, or .zip (if using ZIP for manual setup).C:\Program Files\Java\jdk-25JAVA_HOME.Win + R, type: sysdm.cpl → Enter.JAVA_HOMEC:\Program Files\Java\jdk-25)JAVA_HOME points to the root folder of the JDK, not the bin folder.Path under System variables → click Edit.%JAVA_HOME%\bin%JAVA_HOME%\bin in PATH lets you run java, javac, and other tools from any directory without specifying full path.Open a new Command Prompt and run:
java --version
javac --versionYou should see version 25.x.x without errors.
If that succeeds — your Java setup is complete and ready for use.
12345public class HelloJava25 {
public static void main(String[] args) {
System.out.println("Java 25 is installed correctly on Windows!");
}
}HelloJava25.java (e.g. in C:\learning\java-tests).javac HelloJava25.javajava HelloJava25You should see:
Java 25 is installed correctly on Windows!C:\Program Files\Java\jdk-25) to avoid permission issues.JAVA_HOME & PATH settings, then restart the IDE or terminal.JAVA_HOME to the bin folder.C:\Program Files\Java\jdk-25\binC:\Program Files\Java\jdk-25%JAVA_HOME%\bin to PATH → java / javac commands won’t work.