• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MyJar.jar gives process name as java.exe on windows

 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one executable jar e.g. "MyJar.jar". When I run this jar on linux machine, I am able to figure it out that this jar is running or not as-


But when I run this jar on windows, then I see only java.exe as running process.

Is there a way by which I can identify on windows whether MyJar.jar is running or not?


Thanks,
jai
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Process Explorer instead of the Windows Task Manager. It will still show up as "java.exe" or "javaw.exe", but if you right click on these and select Properties you can see the entire command line that was used to create the process.
 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

Thanks for the info, but I cant expect my application users to install "Process explorer". Is there any another way?


-jai
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you want to do with the process?
 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to allow only one instance to be running of my jar...So, I am checking for the process, if that process is already running then I will pop-out the error message to user stating that , "another instance of Myjar.jar is running"


-akash
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use our search you will find a few threads about the same issue. Some have listed a good few techniques for doing this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic