How to differentiate between different JavaWS applications from the list of processes in the task manager process list?

拈花ヽ惹草 提交于 2019-12-02 20:31:41

问题


I am using JavaWS to launch an application, then how to check whether that application is running or not in the user's machine as it's name in the Task manager process list is not what I gave in the JNLP file.

NOTE. I checked the task Manager process list but there the name of the process is javaw.exe and all the applications which are using JavaWS will have the same name. My question being if the user has launched multiple JavaWS applications then how can we identify the process which we want to check? I thought of getting the PIDs of the process but unfortunately there wasn't any way to get the PIDs of the process. I am working on Windows.


回答1:


..how to check whether that application is running or not in the user's machine..

There's no need to resort to examining processes, an inherently OS specific approach.

The JNLP API offers the SingleInstanceService which..

..allow(s) applications launched under Java Web Start to register themselves as singletons, and to be passed in new parameter sets when user attempts to launch new instances of them.

Your code will then get to decide whether to update the current app., bring it to the front, or launch a new instance.




回答2:


On Windows7 you can select list of colums to display in the Task Manager.

Go to View -> Select Process Page Columns

and select Command line column to be displayed.

You should be able to differentiate between different javaw processes by the command line which includes the class path, main class name etc.



来源:https://stackoverflow.com/questions/39160400/how-to-differentiate-between-different-javaws-applications-from-the-list-of-proc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!