B4J Question launch jar application from the menu

Discussion in 'B4J Questions' started by ivanomonti, Apr 16, 2018.

  1. ivanomonti

    ivanomonti Well-Known Member Licensed 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
     
  2. ivanomonti

    ivanomonti Well-Known Member Licensed User

    Code:
    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
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Johan Hormaza likes this.
  4. ivanomonti

    ivanomonti Well-Known Member Licensed User

    thanks Erel, but I need to send a string to the main opening of the application that I launch, then over the path to open application I have to send variable parameters from case to case
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    This is simple. You can include command line arguments.
     
  6. ivanomonti

    ivanomonti Well-Known Member Licensed User

    Code:
    Dim shl As Shell
                shl.Initialize(
    "shl""java"Array As String("-cp""aps.jar""b4j.example.main""http://www.basic4ppc.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.basic4ppc.com")

    Argoment;

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

    I would have to pass a map of values
     
  7. Daestrum

    Daestrum Well-Known Member Licensed User

    Have you tried the following to run your aps.jar
    Code:
    ...
    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: Apr 17, 2018
  8. ivanomonti

    ivanomonti Well-Known Member Licensed User

  9. ivanomonti

    ivanomonti Well-Known Member Licensed User

    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
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    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.
     
  11. LucaMs

    LucaMs Expert Licensed 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.
     
  12. ivanomonti

    ivanomonti Well-Known Member Licensed User

    no sono reali

    yes my mistake as usual, I had left the ExitApplication command
     
Loading...