How to Set Up a Java Development Environment from Scratch
This guide walks through installing the JDK, configuring JAVA_HOME, PATH and CLASSPATH on Windows, and verifying the setup, showing that only the JDK and a basic text editor are needed to write and run your first Java program.
System requirements
Windows 7, Windows 8, or Windows 10 are the supported operating‑system versions for Java development.
Download JDK
Open a browser and navigate to the Oracle JDK download page:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Select the desired JDK version (e.g., Java SE 8 u291) and the Windows platform. Accept the license agreement, then click the Download button. The download page will prompt for an Oracle account; create one if necessary. The installer file is named jdk-8u291-windows-x64.exe.
Install JDK
Run jdk-8u291-windows-x64.exe. The installer displays the Oracle license; accept it and click Next .
In the Custom Setup dialog, keep the default installation directory C:\Program Files\Java\jdk1.8.0_291\ (or change it as needed) and leave all components selected.
Proceed through the wizard. The installer also installs the Java Runtime Environment (JRE) automatically.
When the JRE installation dialog appears, keep the default settings and continue.
Finish the wizard; the JDK is now installed.
Configure environment variables (Windows)
Open Control Panel → System → Advanced system settings → Environment Variables .
Create a new system variable JAVA_HOME with value C:\Program Files\Java\jdk1.8.0_291.
Edit the existing Path variable. Prepend %JAVA_HOME%\bin followed by a semicolon.
Create a new system variable CLASSPATH with value .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar.
Confirm all dialogs to save the changes.
Verify the configuration
Open a new Command Prompt window and run:
C:\> java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)If the version information is displayed, the environment variables are correctly configured. The same command can be used with javac -version to verify the compiler.
Notes
The JDK bundle already contains the JRE, the javac compiler, and the java launcher, so a separate JRE installation is not required for basic development. Version numbers or installer filenames may differ in future releases, but the installation and configuration steps remain the same.
Lisa Notes
Lisa's notes: musings on daily life, work, study, personal growth, and casual reflections.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
