B4J Question Run jShell in separate thread

jmon

Well-Known Member
Licensed User
Longtime User
I have a B4J app that is just an Updater:
B4X:
'1) checks for updated file

'2) copy that file and replace the old one

'3) run the new file

'4) close updater
The problem I have is that the new file gets closed when I close the updater. This is because I run the new file with jShell:
B4X:
dim sh as Shell
sh.Initialize("", "sudo", Array("java", "-jar", "/home/pi/myUpdatedApp.jar"))
sh.run(5000)

exitapplication
As I understand it, the "myUpdatedApp.jar" is considered as a sub-process of my updater, and when I close the updater, all sub-processes are closed too.

I tried adding and ampersand "&" at the end of the args of jShell, but same problem.

Is there a way to run jShell in a separate process, an not close the executed app?

Thanks for your help
Jmon.
 
Top