Hi,
what I do is to use the following few lines of code at AppStart beginning
'write PID on thefilesystem
Dim jo As JavaObject
jo.InitializeStatic("java.lang.management.ManagementFactory")
Dim pid As String = jo.RunMethodJO("getRuntimeMXBean",Null).RunMethod("getName",Null)
File.WriteString(File.DirApp,"varsvc1pid.txt","VarSvc1: "& pid.SubString2(0,pid.IndexOf("@")))
where
varsvc1pid.txt is the name of the text file showing the PID for the current B4J server app, named after the program name (varsvc1)
and
VarSvc1: is a "label" to again identify the program to which the PID is associated (named after the program name, as above).
udg