M mauro vicamini Active Member Licensed User Longtime User Aug 30, 2019 #1 Hello Evryone! I've developed an application that need to execute a server jar for working. For execute the jar from inside I use this code: B4X: File.Copy(File.DirAssets,"TDeviceLabServer2.jar",File.DirData("TLAB"),"TDeviceLabServer2.jar") sh1.Initialize("shl", "java.exe" , Array As String("-jar", File.Combine(File.DirData("TLAB"),"TDeviceLabServer2.jar"))) sh1.WorkingDirectory = File.DirData("TLAB") sh1.Run(-1) In the ide all works ok. When I build the package with B4jPackager and install the application and then I run it, it's not able to execute B4X: sh1.Initialize("shl", "java.exe" , Array As String("-jar", File.Combine(File.DirData("TLAB"),"TDeviceLabServer2.jar"))) Infact in the folder runtime/bin of the application there is not the java.exe but only the java.dll. How could I resolve this kind of problem? Thanks for the attention.
Hello Evryone! I've developed an application that need to execute a server jar for working. For execute the jar from inside I use this code: B4X: File.Copy(File.DirAssets,"TDeviceLabServer2.jar",File.DirData("TLAB"),"TDeviceLabServer2.jar") sh1.Initialize("shl", "java.exe" , Array As String("-jar", File.Combine(File.DirData("TLAB"),"TDeviceLabServer2.jar"))) sh1.WorkingDirectory = File.DirData("TLAB") sh1.Run(-1) In the ide all works ok. When I build the package with B4jPackager and install the application and then I run it, it's not able to execute B4X: sh1.Initialize("shl", "java.exe" , Array As String("-jar", File.Combine(File.DirData("TLAB"),"TDeviceLabServer2.jar"))) Infact in the folder runtime/bin of the application there is not the java.exe but only the java.dll. How could I resolve this kind of problem? Thanks for the attention.
Erel B4X founder Staff member Licensed User Longtime User Aug 30, 2019 #2 I recommend you to switch to Java 11 and use B4J Packager 11. java.exe should be located in the bin folder. Upvote 0
I recommend you to switch to Java 11 and use B4J Packager 11. java.exe should be located in the bin folder.
xulihang Active Member Licensed User Longtime User Aug 31, 2019 #3 The extension .exe is not necessary and not cross-platform. I use jshell to run other jars, too and I find that it will automatically use the java environment which it runs on. Last edited: Aug 31, 2019 Upvote 0
The extension .exe is not necessary and not cross-platform. I use jshell to run other jars, too and I find that it will automatically use the java environment which it runs on.