Как удалить jdk windows

Details
Written by  
Last Updated on 30 October 2021   |   Print  Email

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.

1. Uninstall Oracle JDK using uninstaller

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:

uninstall jdk

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.

2. Uninstall Open JDK

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.

3. Uninstall Oracle JDK without uninstaller

In case you could not find uninstaller for Oracle JDK, you need to delete the following directories (for example, remove JDK 1.8).

  • JDK installation folder: C:\Program Files\Java\jdk1.8.0_251
  • Java cache folder: C:\ProgramData\Oracle\Java
  • Java updater program: C:\Program Files (x86)\Common Files\Java
  • Java path: C:\Program Files (x86)\Oracle\Java

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:

Other Uninstallation Guides:

  • How to Uninstall NetBeans IDE completely from Windows
  • How to Completely Uninstall Eclipse IDE from Windows computer

About the Author:

Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.

Add comment

Windows 11

Uninstall Java on Windows 11

In this tutorial, we will learn how to uninstall Java on the Windows 11 operating system. The steps depend on the install method.

  • Installed through Java/JDK installer
  • Installed through JDK compressed archive Package

Side note: We can just change the JAVA_HOME to point to another Java install on the machine. There is no need to uninstall Java on the machine if your are switching JDKs.

Below are the steps to uninstall Java from the machine.

Uninstall Java

These steps are applicable for Java/JDK installed using installer.

Open Control Panel

Control Panel >> Programs >> Programs and Features screen

Check for Java JDK program entry in this screen.

Select the Java SE Development Kit <version> and click on the Uninstall link.

Uninstall Java Windows 11

This will launch the uninstaller. Click on Yes button to uninstall the JDK.

JDK Uninstall Wizard Windows 11

Remove environment variables set during Java install process. See below for the instructions to remove system variables.

That’ it. Java or JDK would be uninstalled from the Windows 11 machine.

Uninstall Package

The below steps are applicable if Java / JDK was installed using the compressed archive package on the machine.

Remove JDK directory

Locate the Java JDK home directory and right click on the folder. Delete the Java home directory.

Click on the delete Trash can icon in the context-sensitive menu.

Windows 11 Java Directory Remove

Remove System Variables

Remove the JAVA_HOME environment system variable

  • Click on the Search icon in the Taskbar.
  • Search for environment variables in the Search bar. Click the Edit the system environment variables  link.

Edit System Variables Windows 11

  • Open System properties. Click on the Environment Variables… button
  • In the system variables remove the JAVA_HOME variable. Select JAVA_HOME entry and click on the Delete button.

Delete JAVA_HOME variable Windows 11

Remove Java PATH entry

Remove the Java entry from the PATH environment system variable.

Choose the PATH system environment and click on the Edit… button.

Edit PATH system variable Uninstall Java

Choose the Java path entry can click on the Delete button.

Delete Java Entry Path

That’s it. Java uninstall is complete.

Здравствуйте.
Где-то полгода-год назад я помогал человеку с проблемой: он хотел автоматически удалить всё, что относится к Java, с компьютера под управлением Windows.
Для начала я поискал, есть ли у установщика какой-то ключ, который поможет это сделать.
Уже не помню точно, кажется я таки отыскал его, но функционал был сломан, инсталлятор не выполнял нужной функции.
Дополнительными вариантами я нагуглил всяческие VB-решения, или требующие .NET, как JavaRa.
В конце концов я наткнулся на обсуждение, в котором нашёл одну заветную строчку с полезной командой wmic, и в итоге решение проблемы выродилось в очень небольшой батник, который использует только средства системы, чтобы выполнить то, для чего написаны длиннющие скрипты.
Команда является частью WMI, и присутствует в Windows 2000 и выше.

@echo off
echo Making list of installed Java packages... Please wait.
wmic product where "name like 'Java%%'" get IdentifyingNumber > "%TEMP%\deleteAllJava_1.txt"
type "%TEMP%\deleteAllJava_1.txt" | findstr {........-....-....-....-............} > "%TEMP%\deleteAllJava_2.txt"
if exist "%TEMP%\deleteAllJava_1.txt" del "%TEMP%\deleteAllJava_1.txt"
echo Done. Changing directory...
set VAR="%CD%"
cd %TEMP%
echo Done. Deleting Java packages...
for /f "tokens=*" %%a in (deleteAllJava_2.txt) do (
	echo Deleting package: %%a
	msiexec /x %%a /norestart /qb-!
)
cd %VAR%
echo Making list of installed Java 5 packages... Please wait.
wmic product where "name like 'J2SE%%'" get IdentifyingNumber > "%TEMP%\deleteAllJava_1.txt"
type "%TEMP%\deleteAllJava_1.txt" | findstr {........-....-....-....-............} > "%TEMP%\deleteAllJava_2.txt"
if exist "%TEMP%\deleteAllJava_1.txt" del "%TEMP%\deleteAllJava_1.txt"
echo Done. Changing directory...
set VAR="%CD%"
cd %TEMP%
echo Done. Deleting Java packages...
for /f "tokens=*" %%a in (deleteAllJava_2.txt) do (
	echo Deleting package: %%a
	msiexec /x %%a /norestart /qb-!
)

if exist "%TEMP%\deleteAllJava_2.txt" del "%TEMP%\deleteAllJava_2.txt"
echo Done. Changing directory back...
cd %VAR%
echo Process completed sucessfully...

Думаю, немного пояснений не помешает:
Первая часть удаляет все инсталляции, начинающиеся с «Java» (Java 6 и выше), вторая часть — «J2SE» (Java 5).
Не помню, справляется ли оно с Java 4, но я не думаю, что будет проблемой модифицировать батник.
В каждой части формируется файл %TEMP%\deleteAllJava_1.txt, в нём будут строчки с идентификаторами продукта. Затем с помощью findstr отсеиваются только сами идентификаторы, лишнее убирается. В результате появляется файл %TEMP%\deleteAllJava_2.txt, а первый удаляется. Далее при помощи for перебором строк из второго файла запускается команда на удаление продуктов по идентификатору (msiexec с ключом /x).
Плюс ко всему, запуск батника необходимо производить с правами администратора, тогда запрос UAC будет произведён лишь один раз при запуске, а не каждый раз при деинсталляции пакета.
Стоит заметить, что в случае, если ещё какое-либо приложение будет начинаться со слов Java или J2SE, то оно тоже попадёт под нож, поэтому я буду признателен, если вы расскажете, как стоит исправить этот скрипт, чтобы он не ломал дров.
Также приветствуются полезные замечания по работе скрипта, потому что я не считаю себя мастером в деле написания .bat-файлов. ;)
Спасибо, успешного использования!

UPD1: Более элегантное решение, но удаляет только тогда, когда команда запускается от администратора. Вариант выше, запущенный не от админа будет по крайней мере запрашивать у пользователя разрешение (при включенном UAC), правда, на каждый установленный продукт.

@echo off
echo Removing installed packages of Java 5+... Please wait.
wmic product where "name like 'Java%%' or name like 'J2SE%%'" call uninstall /nointeractive
echo Process completed sucessfully...

Want to learn various ways you can uninstall Java on Windows 11?

One of the most popular programming languages and computing platforms, Java, can take up quite some space on your computer, has slow performance, and is susceptible to many viruses. Thus it wouldn’t be a surprise if you too, like many other users, want to Uninstall Java on Mac or Windows 11 PC.

Though Java is not installed on your computer by default, the websites and programs developed by Java might automatically download it as Java is necessary for them to work.

As it’s not an essential part of Windows, there’s no harm in getting rid of Java, unless of course, you need to run programs based on Java. This guide is all you need if you’ve decided to get rid of it or move towards better alternatives. Below, we’ve discussed different ways you can uninstall Java on Windows 11 and clean your system from its traces.

So what’s the wait for? Let’s get started right away!

1. Uninstall Java From Windows Settings.

One of the easiest and most straightforward ways to remove Java from your computer is through the Windows Settings app. This is how you would remove most of your installed applications.

Let’s take a quick look at the steps for this method:

  1. Press Win + i keys to open Settings. Alternatively, click on the Start menu and choose Settings
  2. From the left pane, click on Apps
  3. Then, choose Apps & features from your screen’s right side. 
Windows 11 Apps settings

  1. Look for the Java app from the list and click on the three horizontal dots next to it. 
  2. Now, select Uninstall from the pop-up options. 
Uninstall Java on Windows 11

  1. Lastly, reboot your computer and check whether the Java app is uninstalled successfully or not.

2. Use the Control Panel to Uninstall Java.

Another way to uninstall Java on Windows 11 is from the Control Panel. It has a dedicated tool for uninstalling any third-party program in your computer. Before Windows 10, this is how users would remove programs from their system since the Settings app offered no such feature.

Use the steps below to do it:

  1. Head over to the Start menu and click on the search bar. 
  2. Type in ‘control’ in the search bar and select Control Panel from the search results. 
  3. The Control Panel window will appear. Now, choose Uninstall a program under Programs
uninstall a program

  1. Now, find the Java app from the list of installed apps and right-click on it. 
  2. Click on Uninstall
Uninstall Java on Windows 11

  1. From the User Account Control prompt that appears, click Yes to continue uninstalling Java from your PC.

Java also offers a dedicated tool to uninstall the outdated versions and provides links to get the latest version available. The tool will automatically scan for the outdated version and remove the program completely with no traces left behind.

Here’s how you can utilize it:

  1. Start by going to the Java official website and select the I Agree to the Terms and Want to Continue button to install the tool on your PC. 
Java Uninstall Tool

  1. Next, click on the JavaUninstallTool.exe file to launch it. 
  2. From the new window that opens, click on Agree to continue. 
Java Uninstall tool wizard

  1. The next screen will show you the available Java versions on your PC. Check the box next to the one you wish to uninstall and choose Next
Uninstall Java on Windows 11

  1. Wait for the uninstalling process to complete and click on Close once the Java is successfully uninstalled on your PC.

4. Uninstall Java Development Kit.

If you have a Java Development Kit like OpenJDK or Oracle JDK installed, you can use any of the above-explained methods to remove it from your computer. But if you remember downloading OpenJDK from an archive file, you can simply delete the extracted folder, which will automatically remove OpenJDK from your system.

5. Clear Java Path From Environmental Variables.

Like any other program, Java also leaves behind its traces if not properly uninstalled. This is because when you install Java, your computer creates a new path and stores it in the environmental variables.

So, when you wish to uninstall Java on Windows 11 for whatever reason, be sure to remove these paths as well so that there are no leftovers of the program to cause installation conflict in the future.

Here’s how to do it:

  1. Go to Settings from your PC by pressing Win + i keys
  2. From the System tab, choose About
System About

  1. Next, click on Advanced system settings
Advanced system settings

  1. The System Properties window will open. From there, choose the Environmental Variables button. 
  1. From the System Variables section, click on the Path variable, and choose the Edit button. 
  1. Click on the paths you want to delete and choose Delete
  1. Lastly, select OK to confirm. 

6. Delete Java Directories.

If you’ve been unable to uninstall Java yet because it does not appear in the Settings or you don’t have the uninstaller program, you can manually delete the Java directories to resolve the issue.

Navigate to these directories and delete them to remove Java from your system:

  • JDK installation folder:
C:\Program Files\Java
  • Java cache folder: 
C:\Program Files\Common Files\Oracle\Java\
  • Java path:
C:\Program Files (x86)\Common Files\Oracle\Java
  • Java update:
C:\Program Files (x86)\Common Files\Java
  • Java install cache:
C:\ProgramData\Oracle\Java

7. Delete Java Leftover Registry Entries.

Uninstalling Java is not always a clean process, as it may leave its traces behind on your computer. Although harmful, they might interfere with the future installation if you ever decide to bring Java back into use. These leftovers include path variables, installation directories, cache data, registry entries, etc.

As we’ve already discussed the steps to delete path variables and directories, let’s now look at how you can take care of the leftover registry entries. Use the instructions below to do so:

  1. Launch the Run dialog box by pressing Win + R keys from your keyboard. 
  2. Type in ‘regedit’ in the field box and click on OK
  3. Now, head to the following path: 
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
  1. The Registry Editor window will appear. Click on Edit from the top bar and choose Find
Registry Editor Windows 11

  1. Then, type in the Java version number you wish to delete and choose the Find Next button. 
  2. The registry key will be highlighted. Now, right-click on it and choose Delete
Uninstall Java on Windows 11

  1. Finally, click on Yes to confirm it. 

8. Use Third-Party Uninstaller Software.

If you prefer a third-party uninstaller app, just ensure it is reliable before going ahead with this method. Some programs include CCleaner, Revo Uninstaller, IObit Uninstaller, and Wise Program Uninstaller. These programs will automatically uninstall Java on Windows 11 along with the program leftovers.

Below, we’ve used Revo Uninstaller to show you the steps:

  1. Start by downloading and installing the uninstaller on your computer. 
  2. After that, open the app and click on the Java app that you want to uninstall. 
  3. Then, click on Uninstall from the top bar.
Uninstall Java on Windows 11

  1. Click on Continue to proceed. 
  2. Then, select Yes
  3. Once Java is uninstalled, click on Scan to look for any remaining files. 
  4. Click on all the residual files and choose the Delete button from the bottom. 
  5. At last, click on Finish

This brings us to the end of our guide on how to uninstall Java on Windows 11. We’ve discussed several different ways you can do so and hope you find them useful. Let us know your feedback in the comment section below. We’ll be happy to hear back from you.

If this guide helped you, please share it. 😊


  • Aimen Choudhry is an architecture student who has always been fascinated by science. She now finds her therapy researching and writing about the latest technology and the issues that come alongside. Otherwise, you’ll find her playing video games, listening to music, or watching fantasy/sci-fi movies.

    View all posts

There are a few different ways to uninstall Java on Windows 10. The most common way is to use the Windows Control Panel. To do this, go to the Start menu and search for «Control Panel.» Once you’re in the Control Panel, go to «Programs and Features» and find the listing for Java. Click «Uninstall» and follow the prompts to remove Java from your computer.

Another way to uninstall Java is to use the Java Uninstall Tool. This tool will automatically remove any older versions of Java that are on your computer. To use the Java Uninstall Tool, go to the Java website and download the latest version of the tool. Once it’s downloaded, double-click the file to run it and follow the prompts.

If you’re having trouble uninstalling Java, you can always contact customer support for help.

How do I uninstall Java properly?

How do I completely remove JDK?

There are a few different ways to remove JDK from your system, depending on what operating system you are using.

On Windows, you can use the Add/Remove Programs feature in the Control Panel to remove JDK.

On Mac OS X, you can use the Java Preferences application to remove JDK.

On Linux, you can use the rpm or yum command to remove JDK.

Should I just uninstall Java?

If you’re not using Java and don’t plan to use it in the future, then yes, you should uninstall it. If you’re not sure whether or not you need Java, then it’s probably best to leave it installed.

Does uninstalling Java require a reboot?

Yes, uninstalling Java requires a reboot.

Should I delete Java on Windows 10?

There is no one-size-fits-all answer to this question, as the decision of whether or not to delete Java from your Windows 10 computer depends on your individual needs and usage habits. However, if you are not using Java regularly or do not need it for any specific purpose, then uninstalling it may be a good option. To uninstall Java from your Windows 10 computer, you can follow the steps below:

1. Open the Control Panel.
2. Click on «Programs and Features.«
3. Select Java from the list of installed programs.
4. Click on the «Uninstall» button.
5. Follow the prompts to complete the uninstallation process.

How do I remove all Java from my computer?

There are a few different ways to remove Java from your computer. One way is to use the «Add or Remove Programs» feature in the Windows Control Panel. Another way is to use a third-party uninstaller program. Finally, you can manually remove Java by deleting the Java files from your computer.

To remove Java using the «Add or Remove Programs» feature, follow these steps:

1. Open the «Add or Remove Programs» control panel.
2. Select «Java» from the list of installed programs.
3. Click the «Remove» button.
4. Follow the prompts to uninstall Java.

To remove Java using a third-party uninstaller program, follow these steps:

1. Download and install a Java uninstaller program.
2. Run the uninstaller program.
3. Follow the prompts to uninstall Java.

To remove Java manually, follow these steps:

1. Close all programs that are using Java.
2. Delete the following files:
* jvm.dll
* javaw.exe
* java.exe
* javaws.exe
3. Delete the following directories:
* C:\Program Files

How do I completely remove Java from Windows?

To remove Java from Windows, you will need to uninstall the Java Runtime Environment (JRE). To do this, go to Control Panel > Programs > Programs and Features, select Java from the list of installed programs, and click Uninstall. You may be prompted to restart your computer to complete the uninstall process. Once Java has been uninstalled, you can delete the Java folder from your Program Files directory.

Is it safe to delete Java?

Yes, it is safe to delete Java from your computer. However, doing so may cause some programs to stop working if they rely on Java. If you are unsure whether you need Java or not, it is best to leave it installed.

Is Java harmful to my computer?

No, Java is not harmful to your computer. In fact, Java is one of the most popular programming languages in the world and is used by millions of developers to create a wide variety of applications.

Is deleting Java safe?

Deleting Java is generally safe, but there are a few things to keep in mind. First, if you have any programs that rely on Java, they will no longer work. Second, some websites may not work properly if you don’t have Java installed. Finally, if you’re not sure whether you need Java or not, it’s usually best to leave it installed.

Will Java mess up my computer?

No, Java will not mess up your computer. However, if you have an older computer, you may want to check to see if your computer can run Java. To do this, go to http://www.java.com and click on the «Do I have Java?» link.

Can Java be uninstalled?

Yes, Java can be uninstalled. The steps to do so will vary depending on the operating system you are using. For Windows, you can use the «Add or Remove Programs» feature in the Control Panel. For Mac, you can use the «Java Preferences» app. Once you have located the Java program, simply follow the prompts to uninstall it.

Is Java really needed?

There is no one-size-fits-all answer to this question, as the need for Java depends on the specific industry and project requirements. However, Java is a versatile and powerful programming language that can be used for a wide range of applications. If you are considering using Java for a project, it is worth considering the benefits that Java can offer.

Can I disable Java?

Yes, you can disable Java from your web browser. Instructions for doing so can be found here: https://www.java.com/en/download/help/disable_browser.xml. Once Java is disabled, you will no longer be able to run Java applications in your web browser.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Обновление windows 11 21h2 до 22h2
  • Kmsauto для windows server 2019
  • Windows 10 где находится главное меню
  • Перечень стандартных программ компьютера windows 10
  • Как превратить windows в linux