B4J Question ExitApplication don't Close Java

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi all,
I have a small app that's only call a shell en then close.
After closing Java is still running.
Any Idea are welcome.

B4X:
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals
   Private shl As Shell
End Sub

Sub AppStart (Args() As String)
   shl.Initialize("shl", "cmd", Array As String("/c", "StartAsService.bat"))
   shl.WorkingDirectory = File.DirApp ' "C:\Users\Roland\Desktop\Listener test\TCP Server\Entrada Connect\Objects" 'File.DirApp
   shl.Run(10000) 'set a timeout of 10 seconds
   StartMessageLoop 'need to call this as this is a console app.
End Sub

'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
   If Success And ExitCode = 0 Then
     Log("Success")
     Log(StdOut)
   Else
     Log("Error: " & StdErr)
   End If
  StopMessageLoop
  ExitApplication
    
End Sub
 
Top