B4J Question jShell with Linux

ThRuST

Well-Known Member
Licensed User
Longtime User
Hi! How to run an application on Linux using jShell?

This works on Windows and Mac. But not Linux.

fx.ShowExternalDocument(File.GetUri(appname, "")) is not useful here since it runs the app but also opens a browser tab in Firefox.
Which is not a desired since only the application should run.

shell:
Dim tstr As String
            tstr = "App.jar"
            Dim shl As Shell
            shl.InitializeDoNotHandleQuotes("shl", "Open", Array As String ("", tstr))       
            shl.WorkingDirectory = File.DirApp
            shl.Run(RunDelay)
 
Last edited:

teddybear

Active Member
Licensed User
If you can run java -jar App.jar in linux cmdline, try the code below

shl.InitializeDoNotHandleQuotes("shl", "java", Array As String ("-jar", tstr))

The document extension is associated with a specific app in windows, so you can use fx.ShowExternalDocument(File.GetUri(appname, "")) to show doc.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@teddybear Nice, I will try that. Thanks
I'm not a terminal worm myself but I understand the file structure on Linux is different and thereby "a challenge".
You need root access and be familiar with the file structure, compatibility between distros is left to chance. But it seems safe.
Perhaps there's a common standard how to shell apps on Linux that I don't know about, but for now your solution are my best bet.
 
Upvote 0
Top