Alex Rivera | Logout

How to prevent that java.exe is installed in Windows' system32?

Asked 2011-11-22T07:45:28.930
20

Is there a way to prevent that the Java installation routine (e.g. jdk-7u1-windows-i586.exe) copies java.exe into C:\Windows\system32 directory?

I have to install my software on a client's laptop and I don't want to break other Java applications which are already installed on the machine. In other words I want to install a private JRE which is only used by my software.

By now, I copied an already installed JRE from my computer to the client's machine.

Edit
Report

3 Answers

9

I discovered yesterday that there is a problem with Java versions on Windows, as you know keeping java up to date these days is critical, especially the JRE used by Internet explorer located in the Windows system32 or syswow64 folder.

You can perform a search for java in your C: drive and look at the various executable files it finds to determine if the situation applies on a specific system.

After doing some research I find that when the Java updater runs, it only updates the files installed in the JAVA home , usually located on the program files, but it does NOT update the files located in the windows system folder. As a result and since the system folder is in the default system PATH , the usage of Internet Explorer continues to use an old version of the JAVA files ( java.exe , javaw.exe , javaws.exe )

The solution is to uninstall java using the control panel uninstall programs feature, download most recent version and install again.

Cheers! Fernando

answered 2012-11-08T14:55:22.833
4

You can just provide the JRE you want to use on your software and:

  • Set the JAVA_HOME variable before you run your application
  • Point to the correct java.exe file (e.g. ..\jre1.5.0_22\bin\java <your_java_main>)

This can be done in a *.bat file for example.

After running the *.bat file you created, all other java version will be ignored and it won't matter which versions are, or will be, installed on that pc.

answered 2011-11-22T08:30:27.033
0

One way I would try would be to create a write-only empty file with the name java.exe into the System32 folder.

answered 2011-11-22T09:52:25.340

Your Answer