Home > Java, Software > Issues uninstalling Java Runtime software

Issues uninstalling Java Runtime software

In small to mid-size environments I prefer to distribute all software using Active Directory and Group Policies. As soon as the computer is started, the software distribution policies will be applied and all assigned applications will be installed automatically.

When upgrading a software package to a more recent version I always select the option to remove the old version first and then install the updated version, instead of performing an in-place upgrade.

I have been using this method for quite some time and I haven’t had any problems, until now…

One of the software packages I generally install on all computers is the Sun (now Oracle) Java Runtime Environment. Previously I didn’t experience any problems while uninstalling this software, but lately the uninstall process takes forever (well, not literally) to complete.

During the software installation phase, the computer is “hanging” while uninstalling the current JRE. If you’re patient enough, the computer will eventually (after an hour or so) display the logon screen. When you log on to the computer you will not be presented with your familiar Windows desktop, but the computer seems to continue the uninstall process in the background.

Then finally, after a quite some time (again an hour or so), the user’s desktop will appear and suddenly it also becomes obvious why the uninstall process for the JRE took so damn long.

Problems uninstalling the Java Runtime Environment

In my experience there are two separate problems that can occur during the removal of the JRE software:

  • The uninstall process cannot continue because one of the files is in use.
  • The uninstall process cannot check the validity of the certificate used to sign a source file.

Fortunately there is a solution to both problems.

Problem #1: file is in use

When we finally manage to get the Windows desktop to show, it will display a dialog box which will indicate the file in use is jqs.exe. This file belongs to the Java Quick Starter service. During the boot sequence this service will be started before the uninstall process takes place. This results in the file being in use when uninstalling the Java JRE.

Simply disabling this service will allow the uninstall process to continue without any problems. This will slightly slow down starting Java applications, but this won’t be a big deal. On Windows Vista or above this service doesn’t have any benefits at all anyway (for more information check http://www.java.com/en/download/help/quickstarter.xml).

I have chosen to disable this service using a group policy that is applied to all computers:

GPO Java Quick Starter

Using the GPO editor, select Computer Configuration | Windows Settings | Security Settings | System Services and set the startup mode for the JavaQuickStarterService to disabled:

Disable jqs

Problem #2: error checking certificate

The second issue involves an error while checking the validity of a certain certificate used to sign one of the source files of the Java JRE. There are possibly multiple reasons for this problem to occur, but in our case it was proxy authentication. The uninstall process runs in the context of the local system account (NTAUTHORITY\SYSTEM) and this “user” cannot be authenticated by the proxy server.

The solution for this problem involves installing the certificate as “Trusted Publisher”. Once the Windows desktop has appeared a dialog box will popup after a few seconds. This dialog box will allow you to view the certificate and it will reveal it is intended for sjremetrics.java.com. Select the Details tab and click Copy To File. This will let you save the certificate as a .CER file.

When the certificate has been saved, open the GPO editor and navigate to Computer Configuration | Windows Settings | Security Settings | Software Restriction Policies | Additional Rules. Right click the right pane and select New Certificate Rule. Use the Browse button to select the saved certificate and set the security level to Unrestricted.

Certificate Rule

After the policy has been applied the certificate will be listed as “Trusted Publisher”.

Certificate

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s