简体   繁体   中英

Launching another java application fails from java web start

As, it is easy to download jars and other artifacts using http://code.google.com/p/jnlpdownloader/

So, I am trying to execute my business application from a small launcher application(this launcher application is running as Java web start application).

This launcher application,

  • first download executable business application jar from URL(available at runtime only)
  • And then execute the executable business jar.

But, the following code doesn't seems to work, nor, it is throwing any exceptions

String[] command = {"java -jar", "JarFromURL.jar"};
        Runtime r = Runtime.getRuntime();
        try {
            r.exec(command);
        } catch (IOException e1) {

            JOptionPane.showMessageDialog(null, "Voilla...") ;
        }

传递给exec()的参数数组应以这种方式拆分。

String[] command = {"java", "-jar", "JarFromURL.jar"};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM