If you’ve ever tried uninstalling Java only to find leftover files or registry entries still lingering around, you’re not alone. Java doesn’t always remove everything cleanly — and those remnants can cause issues when reinstalling a newer version or running apps that rely on Java.
In this detailed guide, we’ll show you how to completely uninstall Java from Windows, remove all leftover files, and clean up your system so it’s ready for a fresh installation or simply to free up space.
Why You Might Want to Uninstall Java
There are several reasons you may want to remove Java completely from your PC:
- No longer needed: You might not use any Java-based apps or tools.
- Corrupted installation: Java isn’t working properly or showing errors.
- Security concerns: Older Java versions can expose your system to vulnerabilities.
- Free up disk space: Old runtime and development files can take up hundreds of MBs.
- Reinstall cleanly: You want to install the latest JDK or JRE without conflicts.
Regardless of your reason, removing Java thoroughly ensures a cleaner, faster, and more secure Windows system.
Step 1: Uninstall Java from Control Panel or Settings
The first step is to remove Java using Windows’ built-in tools.
Using Control Panel
- Press Windows + R, type:
appwiz.cpland press Enter. - In the Programs and Features window, find any entries named:
- Java 8
- Java 17
- Java 21
- Java SE Development Kit (JDK)
- Select each one and click Uninstall.
- Follow the on-screen prompts to complete the removal.
Using Windows Settings (Windows 10/11)
- Press Windows + I to open Settings.
- Go to Apps → Installed Apps (or Apps & Features).
- Search for “Java” in the list.
- Click the three dots next to each Java version and select Uninstall.
Tip: If you’ve installed both JRE (Java Runtime Environment) and JDK (Java Development Kit), uninstall both.
Step 2: Delete Remaining Java Folders
Even after uninstalling, Java leaves residual files behind. To remove them completely:
- Open File Explorer and navigate to:
C:\Program Files\and delete any folder named:Java - Do the same in:
C:\Program Files (x86)\ - Check your AppData folders (press Windows + R and type
%appdata%):- Navigate to:
C:\Users\<YourUsername>\AppData\Localand delete any Sun or Java folder.
- Navigate to:
- Empty your Recycle Bin after deleting these folders.
Step 3: Remove Java Environment Variables
To ensure no Java paths remain in your system environment variables:
- Press Windows + S and type Environment Variables.
- Select Edit the system environment variables.
- In the System Properties window, click Environment Variables.
- Under System Variables, look for:
JAVA_HOMEJDK_HOME
- Select each one and click Delete.
- Also, check the Path variable — click Edit and remove any entries containing:
Java\bin - Click OK on all windows to save changes.
This ensures your system no longer points to any Java directories.
Step 4: Clean Java Registry Entries (Advanced)
Java installations can also leave registry traces. You can clean them manually, but be careful when editing the registry.
- Press Windows + R, type:
regeditand hit Enter. - In Registry Editor, navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\and delete any folder named JavaSoft. - Do the same in:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\and delete the JavaSoft folder if present. - Close Registry Editor once done.
Caution: Be very careful while deleting registry entries. Deleting unrelated keys can cause system instability.
Step 5: Use Java Uninstall Tool (Optional)
If you want to simplify the process, Oracle provides an official Java Uninstall Tool for Windows.
- Visit the official page: https://www.java.com/en/download/uninstalltool.jsp
- Download and run the tool.
- It will automatically detect and remove all Java versions from your system.
This tool helps when manual uninstallation fails or if Java is corrupted.
Step 6: Restart Your Computer
Once you’ve completed all the above steps, restart your PC. This ensures all temporary files and registry changes are cleared.
After restarting, your system will be completely Java-free.
Step 7: Verify That Java Is Removed
To confirm that Java is uninstalled:
- Open Command Prompt and type:
java -versionIf you see:'java' is not recognized as an internal or external command, operable program or batch file.— it means Java is completely removed.
Wrapping Up
And that’s it! You’ve successfully uninstalled Java completely from Windows. Whether you were troubleshooting a broken Java setup, removing old versions, or freeing up space — your system is now clean and ready.
If you plan to reinstall Java later, always use the latest version from Oracle or OpenJDK to ensure better security, performance, and compatibility with modern applications.