27

I have been using JDK 9 on Windows 10 x64 for a while but when I went to install the latest early release (b174), I first uninstalled the previous version (as usual) and then ran the new installer.

It fails with a message box saying "Another Java installation is in progress. You must complete that installation before you can run this installer".

It seems there are some artifacts around causing the problem but only for JDK 9 as I can uninstall & reinstall JDK 8 without any issues. Also, the same problem occurs if I try to run the installers for any prior JDK 9 releases as well (even though they worked before).

Searches have suggested various options like using a Microsoft MSI clean-up tool and registry hacks but nothing is helping.

Can anyone suggest a way to get JDK 9 installed (as now I cannot use any release of JDK 9 at all)?

Clancy Merrick
  • 855
  • 1
  • 8
  • 16
  • Also posted at http://www.javaprogrammingforums.com/whats-wrong-my-code/40246-cant-install-jdk-9-because-%93another-java-installation-progress%94.html – John Joe Jun 22 '17 at 02:38

11 Answers11

63

On Windows, Java prevents starting the Installer twice by creating (two) lock files. If those files exist, Java Installer show the Message: "Another Java installation is in progress (...)".

If Java Installer crashes, or Windows crashes during Java Installation, the installer cannot delete the lock files when finalizing.

Solution:

Deleting the lock files, unlocks the Installer and Java can be installed again.

The lock files are located at:

C:\ProgramData\Oracle\Java\JAVA_INSTALL_FLAG
%USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG
%USERPROFILE%\AppData\LocalLow\Oracle\Java\JAVA_INSTALL_FLAG
mmaynar1
  • 326
  • 4
  • 14
BlackSheeep
  • 743
  • 6
  • 9
  • So you saying that solution is to delete lock files? If so please strip an extra info from your answer (like "I had this problem to" etc) – Aleks Andreev Oct 25 '17 at 17:00
  • This is for Java 9, for **Java 10** see [this answer](https://stackoverflow.com/a/49887937/589259) below. – Maarten Bodewes May 22 '18 at 23:29
  • 4
    In my case (for Java 10), I had an additional lock file at %USERPROFILE%\AppData\LocalLow\Oracle\Java\JAVA_INSTALL_FLAG. Only after deleting all three lock files could I run the installer successfully. – CarLuva Jun 18 '18 at 22:36
  • 1
    Didn't help in my case for java10, tried deleting the lock files, deleted the sun and oracle directories under AppData/LocalLow, still didn't help. What I ended up doing is extracting the files from the install and copying them over to c:/Program Files/java/jdk10.0.2 then using java control panel->java->view->find to add it. Then add the jdk to intellij. Not recommended but works if you tried everything else and are still stuck – lxx Jul 22 '18 at 05:55
  • This worked flawlessly for me. I guess that I had aborted an install a while back. Deleting the oracle JAVA_INSTALL_FLAG allowed me to proceed. Many thanks. – Jeff C. May 19 '21 at 15:50
  • Many thanks, you saved my day. Seriously why these big companies haven't taken care of such little issues don't know. – Atul Dec 11 '21 at 05:06
  • This worked for me to remove Java 8. I had to go through Administrator to find one of these files. Once removed, I was able to install Java 17. – stackoverflow_unicorn Nov 15 '22 at 21:05
  • Also cleaning %temp% folder might be helpful – Rusiru Adithya Samarasinghe Mar 16 '23 at 06:39
10

Although this was written for JDK9, JDK10 will suffer from the same issue BUT the lock location is different. The new lock file is located in %USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG.

Simply deleting this file should allow you to proceed with the install.

AhmedBM
  • 1,202
  • 17
  • 15
10

I had this problem also and i came to this page but i couldn't solve it at first because i thought my system didn't have 'ProgramData' in my C: drive because its hidden i guess. This is what worked for me. Go to the windows file explorer and delete the 'JAVA_INSTALL_FLAG' files in all these directories

%ProgramData%\Oracle\Java
%UserProile%\AppData\LocalLow\Sun\Java
%UserProile%\AppData\LocalLow\Oracle\Java

Then Java jdk installs smoothly. i have recreated this problem and tried this solution again and it works.

heyt0pe
  • 530
  • 7
  • 18
5

This helped me:

DELETE:

%USERPROFILE%\AppData\LocalLow\Oracle\Java\JAVA_INSTALL_FLAG
and
%USERPROFILE%\AppData\LocalLow\Sun\Java\JAVA_INSTALL_FLAG
C B
  • 1,677
  • 6
  • 18
  • 20
NurSultan
  • 61
  • 1
  • 3
2

on windows 10, delete below directories,

C:\Program Files\Java C:\ProgramData\Oracle\Java C:\Users\%UserName%\AppData\LocalLow\Sun\Java C:\Users\%UserName%\AppData\LocalLow\Oracle\Java

and try again.

Kaumadie Kariyawasam
  • 1,232
  • 3
  • 17
  • 35
1

Kill any remaining Windows® installer msiexec.exe processes using the Task Manager of Windows. The Windows installer process apparently locks any java files/processes which blocks the Java JDK to be updated.

My problem installing Java 9 began after I upgraded JetBeans IntelliJ which uses Java JRE/JDK. I first tried the suggested solution that BlackSheeep posted, but without any luck.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
Lex van Buiten
  • 138
  • 1
  • 8
  • 1
    I think you cannot run **any** Windows installers in parallel, so it would not just block Java installs, but **all** software installations. – Maarten Bodewes May 22 '18 at 23:43
  • You are correct. In my case, for some reason the first installation started but got stuck for some reason. Starting a second one isn't possible as you mentioned. – Lex van Buiten May 24 '18 at 06:59
1

On Windows

Delete the file JAVA_MSIUI_FLAG

It can be found in C:\Users\{Computer Name}\AppData\Local\Temp

BlackPearl
  • 2,532
  • 3
  • 33
  • 49
0

Try locating the lock file here:

%USERPROFILE%\AppData\LocalLow\Oracle\Java

Deleting it allowed my Java 10 installation to start.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
martin_
  • 52
  • 3
  • 1
    This answer is a month late to [this answer](https://stackoverflow.com/a/49887937/589259) and contains the same solution, but with less info. – Maarten Bodewes May 22 '18 at 23:24
0

I don't mean to be cheap but Control Panel > Uninstall a program > Java 9 is your friend

MonoThreaded
  • 11,429
  • 12
  • 71
  • 102
0

I blue-screened during a JDK-19_64.msi installation. I have tried restarting and removing the lock files. It kept giving me the "another java installation is in progress."

I fixed it by cleaning out my %temp%\ folder.

0

For Windows 11, and recent Java versions, delete lock files as mentioned by others. Then delete temp files.

1. Press Windows +R
2. Type temp ->delete all files
3. Again press Windows + R -> Type %temp% -> delete all files
Pritam Pawade
  • 637
  • 7
  • 21