Tags

,

If we run a java application, its process name would be java.exe. There may be multiple java.exe in a system, it’s hard to distinguish them. Customer may kill our application by mistake. So we want our java application have a good meaningful name such as MyApp.exe.

One approach is to use executable wrapper like 
Launch4jWinRun4JJanelNSIS to creates native Windows launchers for java application.

Another approach described is to use Apache Procrun to run the java application as a windows service. 

One good side effect is that we can give the process an meaningful name such as MyApp.exe. All we need do is rename prunsrv.exe to MyApp.exe. In install-service script and start|stop|uninstall scripts, we replace every occurrence of prunsrv.exe to MyApp.exe.


set PRUNSRV=%~dp0%MyApp.exe
“%PRUNSRV%” //IS//%SERVICE_JAVA% –Install=”%PRUNSRV%”

//<![CDATA[
if(showAdsense){
document.write("(adsbygoogle = window.adsbygoogle || []).push({});”)
}
//]]>

Please read the full code from  
Windows BAT: Using Apache Procrun to Install Java Application As Windows Service

via Blogger http://lifelongprogrammer.blogspot.com/2014/01/using-apache-procrun-to-rename-java-process-name.html

Advertisements