Hello Devs,
I'm working on a simple B4J app that runs fine from the ide, B4J V8.30.
When the app is packaged to an EXE using the internal packager (Project->build stndalone package), it crashes on a specific sub that make use of javaobject:
ub getAppPid As String
Dim jo As JavaObject
jo.InitializeStatic("java.lang.management.ManagementFactory")
Dim pid As String = jo.RunMethodJO("getRuntimeMXBean",Null).RunMethod("getName",Null)
pid= pid.SubString2(0,pid.IndexOf("@"))
Log("[PB] this pid : " & pid)
Return pid
End Sub
It looks like the java.lang.management.ManagementFactory class is missing from the packaged app.
To record the error, I used a messagebox, so here is the screenshot:
As I said, it doesn't happen running from the ide.
I'm sure there will be different approaches to get the app PID, but I think it is useful to report the error.
Cheers
Davide