uniplan Active Member Licensed User Longtime User Jan 13, 2017 #1 I would run from my B4J application another .jar application. The two applications run in Windows environment. it's possible? How? if it were possible I would like to also have the ability to kill at a later time the process I launched.
I would run from my B4J application another .jar application. The two applications run in Windows environment. it's possible? How? if it were possible I would like to also have the ability to kill at a later time the process I launched.
eurojam Well-Known Member Licensed User Longtime User Jan 13, 2017 #2 did you try the jShell library: https://www.b4x.com/android/forum/threads/jshell-library.34661/ Upvote 0
uniplan Active Member Licensed User Longtime User Jan 13, 2017 #3 I tried the library Jshell with this code: Code: Copy Dim shl As Shell shl.Initialize("shl","B4JwebApp.jar",Null) shl.WorkingDirectory = "G:\moduli_software\B4J-BrokerD\test" shl.Run(10000) 'set a timeout of 10 seconds But I have this error: Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "B4JwebApp.jar" (in directory "G:\moduli_software\B4J-BrokerD\test"): CreateProcess error=2, Can not find the file specified) Click to expand... I am sure that the file is in specified path. Upvote 0
I tried the library Jshell with this code: Code: Copy Dim shl As Shell shl.Initialize("shl","B4JwebApp.jar",Null) shl.WorkingDirectory = "G:\moduli_software\B4J-BrokerD\test" shl.Run(10000) 'set a timeout of 10 seconds But I have this error: Error: org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "B4JwebApp.jar" (in directory "G:\moduli_software\B4J-BrokerD\test"): CreateProcess error=2, Can not find the file specified) Click to expand... I am sure that the file is in specified path.
udg Expert Licensed User Longtime User Jan 13, 2017 #4 Look at post #13 in that same thread. You should do something like: Code: Copy shl.Initialize("shl", "java.exe" , ArrayAsString("-jar", "Server_report.jar",name)) The idea is to run java.exe with the "-jar" parameter, followed by your app name (ending in ".jar") and its parameter (if any). Upvote 0
Look at post #13 in that same thread. You should do something like: Code: Copy shl.Initialize("shl", "java.exe" , ArrayAsString("-jar", "Server_report.jar",name)) The idea is to run java.exe with the "-jar" parameter, followed by your app name (ending in ".jar") and its parameter (if any).
EnriqueGonzalez Expert Licensed User Longtime User Jan 13, 2017 #5 Or easier you can use: Code: Copy fx.ShowExternalDocument(File.GetUri("Path","File")) Upvote 0
uniplan Active Member Licensed User Longtime User Jan 13, 2017 #6 udg said: Look at post #13 in that same thread. You should do something like: Code: Copy shl.Initialize("shl", "java.exe" , ArrayAsString("-jar", "Server_report.jar",name)) The idea is to run java.exe with the "-jar" parameter, followed by your app name (ending in ".jar") and its parameter (if any). Click to expand... I try it and is OK. Thanks. Upvote 0
udg said: Look at post #13 in that same thread. You should do something like: Code: Copy shl.Initialize("shl", "java.exe" , ArrayAsString("-jar", "Server_report.jar",name)) The idea is to run java.exe with the "-jar" parameter, followed by your app name (ending in ".jar") and its parameter (if any). Click to expand... I try it and is OK. Thanks.