Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Launch 2 applications sametime windows (http://www.velocityreviews.com/forums/t134602-launch-2-applications-sametime-windows.html)

bigbinc 06-23-2004 02:22 AM

Launch 2 applications sametime windows
 
I want to launch two java applicafions at the same time in windows.

I have a linux script that launches the first application, the
server, in the background, waits 5 seconds then launches the client,
can I do something similar in windows.

My first thought is write a script that launches two other *.bat
files,

My second thought is write a small java application that forks two
java VMs similar to what ANT does.

My third is to write a windows C application, but I am scared about
portability with windows versions?(COM?)

My fourth is to screw windows it sucks, let those users screw
themselves.


I dont want to use the Services yet.

Michael Borgwardt 06-23-2004 07:44 AM

Re: Launch 2 applications sametime windows
 
bigbinc wrote:

> I want to launch two java applicafions at the same time in windows.
>
> I have a linux script that launches the first application, the
> server, in the background, waits 5 seconds then launches the client,
> can I do something similar in windows.


I think all you need is javaw.exe instead of java.exe

Eric Sosman 06-23-2004 06:41 PM

Re: Launch 2 applications sametime windows
 
bigbinc wrote:
> I want to launch two java applicafions at the same time in windows.
>
> I have a linux script that launches the first application, the
> server, in the background, waits 5 seconds then launches the client,
> can I do something similar in windows.
>
> My first thought is write a script that launches two other *.bat
> files,
>
> My second thought is write a small java application that forks two
> java VMs similar to what ANT does.
>
> My third is to write a windows C application, but I am scared about
> portability with windows versions?(COM?)
>
> My fourth is to screw windows it sucks, let those users screw
> themselves.
>
>
> I dont want to use the Services yet.


Others have suggested ways of doing exactly what you
asked for, but I'm wondering: Is there some special reason
you actually need two JVMs? Could you simply run the two
applications in two threads in one JVM?

--
Eric.Sosman@sun.com


bigbinc 06-24-2004 11:00 AM

Re: Launch 2 applications sametime windows
 
Eric Sosman <Eric.Sosman@sun.com> wrote in message news:<40D9CEDB.8060200@sun.com>...
> bigbinc wrote:
> > I want to launch two java applicafions at the same time in windows.
> >
> > I have a linux script that launches the first application, the
> > server, in the background, waits 5 seconds then launches the client,
> > can I do something similar in windows.
> >
> > My first thought is write a script that launches two other *.bat
> > files,
> >
> > My second thought is write a small java application that forks two
> > java VMs similar to what ANT does.
> >
> > My third is to write a windows C application, but I am scared about
> > portability with windows versions?(COM?)
> >
> > My fourth is to screw windows it sucks, let those users screw
> > themselves.
> >
> >
> > I dont want to use the Services yet.

>
> Others have suggested ways of doing exactly what you
> asked for, but I'm wondering: Is there some special reason
> you actually need two JVMs? Could you simply run the two
> applications in two threads in one JVM?



Ok, assume two java applications have 2 static main methods

public static void main(){}

I am already having trying to avoid deadlock with one of the
applications and keeping up with all the other threads, I am trying to
avoid starting the application in 2 threads. But, If I were to do so,
what would be the best way to go about this :


public static void main(String [] args) {

App01.main(args);
App02.main(args);

}


All times are GMT. The time now is 10:48 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.