In this short post, I’d like to share with you how to completely remove Java Development Kit (JDK) from Windows operating system, both Oracle JDK and OpenJDK, even without uninstaller program.
You should uninstall old version of JDK that is no longer used, for security reason because newer JDK always has improved security.
On Windows 10, click menu Start > Settings, then click Apps in Settings window. Under Apps & Features, click on the JDK version you wish to remove:
Just click Uninstall two times and it will remove JDK quickly from your operating system. You can verify by typing java -version in command prompt, and check the directory C:\Program Files\Java.
If you have OpenJDK installed from Zip archive, just delete the whole extracted directory. You can type where java in command prompt to know the installation directory:
Then change the current directory to OpenJDK directory and type the following command:
del /s /f /q jdk-15
You can also press Shift + Delete on a folder in Windows explorer.
In case you could not find uninstaller for Oracle JDK, you need to delete the following directories (for example, remove JDK 1.8).
That’s how to uninstall JDK (both Oracle JDK and OpenJDK) from Windows computer. To see the steps in action, I recommend you watch this video: