Hi,
I am using an non-UI app and trying to run a .jar file with shell.
When I use command line and I use the following it works:
/opt/jdk-14/bin/java -jar /opt/CloudServer/tool.jar Args1 Args2 Args3 Args4
However, when I use the following code in my B4J app it comes up with an error..
(not 100% sure if this is the way in doing this)
The error it shows is:
I can't work out why it's not working in B4J when it works fine in command line.
Any one know why this doesn't work ?
I am using an non-UI app and trying to run a .jar file with shell.
When I use command line and I use the following it works:
/opt/jdk-14/bin/java -jar /opt/CloudServer/tool.jar Args1 Args2 Args3 Args4
However, when I use the following code in my B4J app it comes up with an error..
(not 100% sure if this is the way in doing this)
B4X:
Dim shl As Shell 'jShell Lib v1.52
Dim Args As List
Args.Initialize
Args.Add("-jar")
Args.Add("tool.jar")
Args.Add("Args1")
Args.Add("Args2")
Args.Add("Args3")
Args.Add("Args4")
shl.InitializeDoNotHandleQuotes("shl","/opt/jdk-14/bin/java", Args)
shl.WorkingDirectory = "/opt/CloudServer"
shl.Run(10000)
Wait for shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Log(Success & "; ExitCode = " & ExitCode)
Log("StdOut = " & StdOut)
Log("StdErr = " & StdErr)
The error it shows is:
false; ExitCode = -559038737
StdOut =
StdErr = org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/opt/jdk-14/bin/java" (in directory "/opt/CloudServer"): error=13, Permission denied)
I can't work out why it's not working in B4J when it works fine in command line.
Any one know why this doesn't work ?