Re: Launch a new java app from a java program



In article <1183134928.246088.176660@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
bencoe@xxxxxxxxx wrote:

On Jun 29, 12:30 pm, Yao Qi <qiyao...@xxxxxxxxx> wrote:
I want to write a java program A to launch another java app B. I hope I
could configure the argument of VM to launch java app B, just like what
Eclipse JDT does.(Eclipse is a java program, and it could launch other
java apps.) I do not want to create a new thread for java app B. I
prefer to run java app B on another process separately.

How could I do this?

Best Regards

--
Yao Qi <qiyao...@xxxxxxxxx> GNU/Linux
Developerhttp://duewayqi.googlepages.com/

"The world is beating a path to our door"

-- Bruce Perens, (Open Sources, 1999 O'Reilly and Associates)

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.
String)

Runtime.exec("command");

will probably do the trick.

-----
Ben
http://www.plink-search.com

It will *definitely* do the trick (we do it in a small number of places
in our own app). But I would strongly discourage the use of that
specific exec method...the one accepting a String array will almost
always be safer.
--
Steve W. Jackson
Montgomery, Alabama
.



Relevant Pages

  • Re: Launch a new java app from a java program
    ... could configure the argument of VM to launch java app B, ... Eclipse JDT does.(Eclipse is a java program, ... I do not want to create a new thread for java app B. I ...
    (comp.lang.java.programmer)
  • Re: JNI UnsatisfiedLinkError
    ... I tried compiling the libHelloWorld.so with - ... m32 and that seems to have done the trick. ... Running the Java app: ...
    (comp.lang.java.programmer)