Introduction
In order to avoid a reboot or occurrence of a pop-up which requests to reboot the OS if a newer version of Java will be installed silently, all processes which are using Java have to be killed.
Just killing java.exe by executing the following command:
taskkill /im java.exe /f
does not solve the issue as some processes will continue to use java, e.g. postgresql JDBC, webbrowsers, tomcat, eclipse.
If all processes which are using Java are killed before Java will be installed silently, the OS will not be rebooted.
The approach to kill processes individually which are using java is not a persistent solution as if another program will be installed in the future which will use java and not be killed, the system will be rebooted again if java will be installed silently.
Question
How to find all processes which are using java and kill them all to avoid OS will be rebooted or a pop up will occur which requests to reboot the system if Java will be installed silently?
file --help
has been executed and a number of commands appears. Which of these should be used in order to determine which processes are using Java?file /path/to/java
results inC:\Program Files\Java\jdk1.8.0_05\bin\java.exe; PE32+ executable for MS Windows (console) Mono/.Net assembly
.Apache Directory Studio
(C:\Program Files\Apache Directory Studio\Apache Directory Studio.exe; PE32+ executable for MS Windows (GUI) Mono/.Net assembly) andTomcat
(C:\Program Files\Apache Software Foundation\apache-tomcat-8.0.8\bin\tomcat8.exe; PE32+ executable for MS Windows (console) Mono/.Net assembly) which are neither Java based nor using java, while java is required to run these programs.