B4J Question Kill and restart a standalone .exe from another B4J app

marcick

Well-Known Member
Licensed User
Longtime User
Hi all,

as the title says, from a B4J app acting as a "watchdog" I would like to:

1. Check if another B4J app (built as a standalone .exe, not a .jar) is currently running.
2. If it is, be able to kill it.
3. Restart it afterwards.

This is running on Windows Server.
Any hints or sample code would be very appreciated.
 
Solution
Thank you. I discovered it is needed a B4j/ prefix:

B4X:
Wait For (Caller.KillJavaProcess("b4j/it.sample.main")) Complete (Counter As Int)

marcick

Well-Known Member
Licensed User
Longtime User
Thants, I saw that example.
No problem for starting with Jshell, but for killing it is not clear to me.
Once the package name is for example it.sample and the exe name in sample.exe, how to use that code that looks for jar ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Thank you. I discovered it is needed a B4j/ prefix:

B4X:
Wait For (Caller.KillJavaProcess("b4j/it.sample.main")) Complete (Counter As Int)
 
Upvote 0
Solution
Cookies are required to use this site. You must accept them to continue using the site. Learn more…