B4J Question launch jar application from the menu

ivanomonti

Expert
Licensed User
Longtime User
I want to create small applications that I use as separate additional modules (plugins) and launch these modules separated by a menu on the master application (like photoshop) ,,, is it possible?

2018-04-16_010557.png
 

ivanomonti

Expert
Licensed User
Longtime User
B4X:
fx.ShowExternalDocument(File.GetUri(File.Combine(File.DirApp,"plugins"), "aps.jar"))

at the moment I found this command, but I would need to send some parameters to the application I launch
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
B4X:
            Dim shl As Shell
            shl.Initialize("shl", "java", Array As String("-cp", "aps.jar", "b4j.example.main", "http://www.b4x.com"))
            shl.WorkingDirectory = File.Combine(File.DirApp,"plugins")
            shl.Run(10000) 'set a timeout of 10 seconds
            StartMessageLoop 'need to call this as this is a console app.

Array As String("-cp", "aps.jar", "b4j.example.main", "http://www.b4x.com")

Argoment;

  1. -cp = ?
  2. aps.jar = application that I launch
  3. b4j.example.main = ?
  4. http://www.b4x.com = ?

I would have to pass a map of values
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Have you tried the following to run your aps.jar
B4X:
...
shl.Initialize("shl", "java.exe", Array As String("-jar", "aps.jar"))
...

As regard your other query in post #6

1, -cp classPath - tells java where to look for referenced libraries or jars
3, just a parameter that the example needed. (looks like the entry point into the jar)
4, just another parameter
 
Last edited:
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
Have you tried the following to run your aps.jar
B4X:
...
shl.Initialize("shl", "java.exe", Array As String("-jar", "aps.jar"))
...

As regard your other query in post #6

1, -cp classPath - tells java where to look for referenced libraries or jars
3, just a parameter that the example needed. (looks like the entry point into the jar)
4, just another parameter

I have the problem that when I close app called with {shl.Initialize("shl", "java", Array As String("-cp", "args.jar", "b4j.example.main", "Ivano Monti"))}, it also closes the parent app
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
Spero siano fasulli ma si vedono il tuo indirizzo ed il tuo numero di telefono.

I hope they are fake but you can see your home address and phone number.

no sono reali

Closing the child process shouldn't affect the parent process. I guess that you are doing something wrong in ProcessCompleted event. Check the logs for errors.

yes my mistake as usual, I had left the ExitApplication command
 
Upvote 0
Top