Recommended Free Tools
Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Install a JDK, not a JRE, then make sure your editor and shell point to that same JDK. For a new learner, JDK 25 is the long-term baseline identified by Oracle at the time covered here (2026), although an existing project should take priority if it requires another release. Choose a reputable OpenJDK distribution, install VS Code’s Java tooling, configure JAVA_HOME and Path where your operating system needs them, and verify both java and javac. The six questions below explain what each setting does, how VS Code discovers Java, and how to recover when it reports that no JDK is available.
Do I need a JDK or a JRE for Java development?
You need the JDK (Java Development Kit). It contains the Java runtime plus development tools such as the Java compiler, javac. A runtime-only installation can launch an application, but it cannot compile your source code or provide the complete toolchain expected by an editor and build system.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Oracle’s installation guidance states: “To develop or run Java applications, download and install JDK.” That wording matters even if your immediate goal is only to run a sample: development tools prevent a second installation later and let VS Code compile, test, and debug your code.
- JDK: the package to install for writing, compiling, testing, debugging, and running Java.
- JRE or runtime: the execution portion, useful for launching software but insufficient for a normal development workflow.
javac: the command that turns.javasource into bytecode; its presence is a quick indication that a development kit is installed.
When an installer offers a choice between a runtime and a development kit, select the JDK. Point tools to the JDK’s top-level directory, not to a separate runtime folder and not to its bin subdirectory.
Which Java version should I install?
Use the version required by your project. If you are starting from scratch and want a stable, supported baseline, Oracle’s downloads page identified JDK 25 as the latest Long-Term Support (LTS) release at the 2026 page state used for this guide. The same page identified JDK 27 as the latest Java SE feature release. Release labels change, so check Oracle’s current page when you install rather than assuming these designations remain unchanged.
| Choice | What it means | Best fit | Important qualification |
|---|---|---|---|
| JDK 25 LTS | A long-term support baseline | New learners, teaching material, and applications intended to stay on one supported line | The LTS designation and available support depend on the vendor’s current policy; Oracle’s 2026 page state is the cited snapshot. |
| JDK 27 feature release | The newest Java SE release listed by Oracle at that page state | Trying the newest language and platform features or following a project that explicitly requires it | Feature releases move faster, so confirm that libraries, build plugins, and deployment targets support it. |
| Another version | A project-selected release, which may be older or newer | Existing Maven, Gradle, classroom, enterprise, or deployment projects with a declared requirement | Compatibility with the project’s build file and runtime is more important than a generic “latest” label. |
Read the project’s README, build configuration, container image, or CI settings before installing. A project that specifies Java 17, for example, should be built and tested with the expected 17-compatible toolchain even if a newer JDK is available. You can keep multiple JDKs installed and select the one a project needs; the selection methods are covered below.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWhat does LTS mean in Java?
Long-Term Support describes a release line that a vendor commits to maintain for a longer period than a short-lived feature release. LTS is a support and maintenance choice, not a separate language edition and not a guarantee that every vendor offers identical dates or update terms.
For a learner, an LTS release reduces churn: tutorials and dependencies are more likely to target it, and you can remain on that major version while receiving the vendor’s security and bug-fix updates. A feature release is useful when you deliberately need a newly introduced capability or when a project mandates it, but it may require more frequent upgrades.
- Check the support schedule and update policy of the distribution you select; “LTS” does not erase differences between vendors.
- Do not upgrade a production or school project solely because a newer feature release exists. Test the project’s compiler, plugins, libraries, and deployment runtime together.
- Record the major version in project documentation so another contributor can reproduce the setup.
Which JDK distribution should I choose?
No single vendor is mandatory. Install a reputable OpenJDK distribution that supports your operating system and CPU architecture and whose licensing and update terms fit your use. Microsoft’s Windows guidance says Microsoft Build of OpenJDK or Eclipse Temurin are good choices for most developers. VS Code’s documentation also lists Oracle Java, Amazon Corretto, Azul Zulu, IBM Semeru Runtimes, Red Hat build of OpenJDK, and SapMachine.
| Decision axis | Questions to answer before downloading | Why it matters |
|---|---|---|
| Project compatibility | Does the project name a major Java version, vendor, or JVM feature? | Build plugins and native libraries can have narrower support than the Java language itself. |
| Operating system and CPU | Is there an installer or archive for your Windows, macOS, or Linux edition and your processor architecture? | A correct major version with the wrong architecture will not run or will require emulation. |
| License and updates | What terms apply to development, redistribution, commercial use, and security updates? | Licensing and update policies can differ, particularly among Oracle distributions and other vendors. |
| Installation experience | Does the vendor provide a package manager, graphical installer, or archive appropriate to your system? | Automatic registration and upgrade behavior affect how easily shells and editors discover the JDK. |
| Tool discovery | Does the installation expose a clear JDK home directory for JAVA_HOME and VS Code? |
Tools need the JDK root; pointing them at the wrong folder causes “no JDK found” errors. |
| Release cadence | Do you want an LTS line or a faster feature-release cycle? | The cadence determines how often you must plan upgrades and compatibility testing. |
Download from the chosen vendor’s official distribution page and read its current terms. Do not mix a project that requires one vendor’s patches with an untested replacement without checking the project’s support statement. For ordinary learning on Windows, the two choices Microsoft highlights are a sensible starting point; the important requirement is a complete, compatible JDK rather than a particular logo.
Rank #2
How do I install Java and VS Code in the right order?
Install a JDK first, then VS Code and its Java extensions. The order is not strictly required, but installing the JDK first makes runtime detection easier and gives you an immediate command-line test.
Windows
- Download the JDK distribution and architecture that match your Windows installation.
- Run the installer and note the destination folder. This folder is the JDK home; it normally contains directories such as
binandlib. - Open a new PowerShell or Command Prompt window and run
java -versionandjavac -version. If both commands return versions, the installer has made Java visible to that shell. - Install VS Code, open Extensions, and install the Extension Pack for Java, or choose the Java General profile when VS Code offers profiles.
- Open a
.javafile or a project. VS Code can read and debug a standalone Java file without a project, but a Maven or Gradle project should retain its build configuration.
macOS
- Install a JDK package for your Mac’s processor architecture and note its installed version.
- Open Terminal and run
java -versionandjavac -version. - Install VS Code and the Extension Pack for Java, then use the runtime command described in the next section if the editor does not select the expected JDK.
macOS includes the /usr/libexec/java_home utility for selecting a JDK version. Oracle documents it as the way to select a version for command-line use; /usr/bin/java finds the newest installed JDK when command-line tools invoke it.
Linux
Use the package method supported by your distribution or install the vendor’s archive, then ensure the shell’s Java command resolves to that JDK. Package names and environment-file locations differ among distributions, so follow the distribution and vendor instructions rather than copying a Windows path. Verify with the two version commands before opening VS Code.
How does VS Code find and select a JDK?
VS Code’s Java tooling requires a JDK. The Extension Pack for Java supports Java 1.8 and above, and VS Code can use a locally installed runtime or download one through its Java tooling.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Install the Extension Pack for Java from the Extensions view, or activate the Java General profile.
- Open the Command Palette with View > Command Palette.
- Run Download, install, and Use JDK. This command, documented by dev.java, can install a JDK or select one that is already available.
- To inspect or change detected runtimes, run Java: Configure Java Runtime. Review the paths and the runtime marked as the default.
For multiple JDKs, configure the java.configuration.runtimes setting in VS Code. Each entry maps a Java version to a JDK home; mark one entry as the default for unmanaged folders when needed. A project managed by Maven or Gradle should declare its required JDK in the build configuration, because the build tool’s toolchain or wrapper can impose a version that differs from the editor default.
VS Code can open and debug a standalone .java file, which is useful for a quick exercise. Once you add dependencies, tests, or a build lifecycle, open the complete Maven or Gradle folder so the Java language server can import the project’s configuration.
What are JAVA_HOME and PATH, and how do I set them?
JAVA_HOME identifies the JDK directory for tools such as Maven, Gradle, and Android Studio. Path tells the shell where to find executables such as java and javac. They are related but not interchangeable: setting one does not automatically repair a wrong value in the other.
Windows: set JAVA_HOME and Path
- Locate the JDK home directory from the installer. Use the directory above
bin; for example, if the compiler is inC:Program FilesJavajdk-25binjavac.exe, the JDK home isC:Program FilesJavajdk-25. - Open Settings, search for Environment Variables, and choose Edit the system environment variables. In System Properties, select Environment Variables.
- Create or edit
JAVA_HOMEand set its value to the JDK home directory, without addingbin. - Edit the system
Pathvariable and add%JAVA_HOME%bin. - Confirm the dialogs, close existing terminals, and open a new PowerShell or Command Prompt. Microsoft’s Windows guidance specifically calls for a new terminal after changing these values.
- Run
java -version,javac -version, and in PowerShellecho $env:JAVA_HOME.
If several Java entries are in Path, the first matching entry normally wins. Move the intended JDK entry ahead of obsolete Java folders or remove entries you no longer use, then open a new terminal again.
macOS: use java_home when you need a specific version
Run /usr/libexec/java_home to work with the installed JDK selection documented by Oracle. When a tool needs a particular major version, use the utility’s version-selection form supported by your macOS installation and export the resulting directory as JAVA_HOME in the shell session or shell startup file. The exact startup file depends on your shell, so check which shell your terminal uses before editing it.
macOS’s /usr/bin/java can find the newest installed JDK for command-line tools. That behavior may differ from the JDK selected inside VS Code or by a project’s build tool, so verify each context separately.
Linux: follow the distribution’s environment conventions
Linux installations vary by distribution and package method. Set JAVA_HOME to the installed JDK root using the environment mechanism your distribution documents, and make sure its bin directory is available on PATH. If you installed an archive alongside a package-managed JDK, check the shell’s active executable and the editor’s configured runtime instead of assuming they match.
How do I check which Java version is active?
Check both the runtime and compiler, because they can resolve differently when multiple installations or stale environment entries exist.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #4
- Run
java -versionto display the runtime version. - Run
javac -versionto display the compiler version. - On Windows PowerShell, run
echo $env:JAVA_HOMEto see the configured JDK home. - In VS Code, run Java: Configure Java Runtime and inspect the detected paths and project assignment.
The version numbers should be compatible with the project you intend to build. A shell can report one JDK while VS Code uses another, and a Maven or Gradle toolchain can select a third. Treat each result as a separate checkpoint rather than assuming one command proves every tool is configured.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why does VS Code say “no JDK found”?
The message usually means VS Code cannot see a valid JDK home, the extension pack is missing, or the editor has not reloaded changes made after installation. Work through the checks in order.
1. Confirm that you installed a JDK
Run javac -version in a new terminal. If the command is missing, install a development kit rather than a runtime-only package.
2. Check the selected folder
In Java: Configure Java Runtime or java.configuration.runtimes, point to the JDK home directory. Do not select the bin directory itself. The home should contain the JDK’s standard subdirectories and compiler.
3. Reload the environment
Close and reopen the terminal after changing JAVA_HOME or Path. Restart VS Code as well; an already-running editor may retain the old environment.
4. Check for competing installations
If java -version and javac -version show an unexpected release, inspect the order of Path entries on Windows or the active shell configuration on macOS and Linux. Remove stale entries or move the desired JDK ahead of them.
Best Value
5. Respect the project’s own requirement
A Maven or Gradle project may declare a required JDK that differs from the editor’s default. Read its build configuration and set the corresponding runtime or toolchain instead of forcing the global default onto it.
6. Use the downloader when no local JDK is ready
From the Command Palette, run Download, install, and Use JDK. After installation, return to Java: Configure Java Runtime and confirm that the new path is selected.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Which setup route is best for a beginner?
Choose the route that matches how you will work, not simply the newest download button.
| Your situation | Recommended route | Checks to perform |
|---|---|---|
| Learning Java with small files | Install an LTS JDK, VS Code, and the Extension Pack for Java | Open a standalone file, run both version commands, and confirm the runtime in VS Code. |
| Joining an existing project | Install the project’s specified major version and compatible distribution | Read the build file, configure the matching VS Code runtime, and run the project’s normal build command. |
| Working on several projects | Keep multiple JDKs and map them with java.configuration.runtimes |
Mark a default only for unmanaged folders; let Maven or Gradle project settings control managed builds. |
| Using Windows with command-line builds | Set JAVA_HOME to the JDK root and add %JAVA_HOME%bin to system Path |
Open a new terminal and compare java, javac, and JAVA_HOME. |
| Using macOS with several installed JDKs | Use /usr/libexec/java_home for version selection and inspect VS Code separately |
Check which JDK /usr/bin/java resolves and which one the editor reports. |
What should I learn after Java is working?
Start by compiling and running a tiny class, then open a project with a clear build file. Learn how the project’s declared Java version, compiler settings, tests, and dependency manager fit together before changing the global JDK. When you later need a different release, install it alongside the working one, select it for that project, and rerun the two version checks before troubleshooting the code itself.
Frequently Asked Questions
Can I install more than one JDK on the same computer?
Yes. Multiple JDKs can coexist, but each shell, editor, and build tool may select a different one. Use VS Code’s java.configuration.runtimes for editor mappings, keep the intended Windows Path entry first, and let Maven or Gradle toolchains follow the project’s declared version.
Why do java -version and javac -version show different releases?
The two commands are being resolved from different locations, usually because an older runtime appears earlier in Path or a shell startup file overrides the compiler location. Inspect the active executable paths, correct the ordering or environment variables, open a new terminal, and check both commands again.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Does setting JAVA_HOME force every Java project to use that version?
No. JAVA_HOME is a convention used by many tools, while Maven and Gradle can apply their own toolchain or wrapper settings. A project configuration can therefore select a JDK different from the global environment or VS Code default.
Can VS Code run a Java file without Maven or Gradle?
Yes. The Java extensions can read and debug a standalone .java file. Once your code needs dependencies, tests, or repeatable packaging, open the complete Maven or Gradle project so the editor can import its build configuration.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

