Re: Execute Java in a new window

From: BlackHawke (blackhawke_at_legacygames.net)
Date: 02/10/04


Date: Tue, 10 Feb 2004 00:47:00 GMT

Interesting.....

>The
> reason that does not work is that in is actually the shell (cmd.exe or
> command.com) that does such things.

Bingo.

> You have a couple of options. You can replace the updater with a BAT
> file that launches the updater, waits for it to finish and then launches
> the client.

We've considered that. It causes other issues, but may be a last resort.

> Runtime.exec("cmd /c java ...");
>

OHOHOHOH.... I think you have something there my friend... I think that may
just do it.... Won't work on lunix systems, which are a minority in our
project, but may be the best method I've seen to date!

Thanks!!!

> BTW, this is an interesting business model you have, solving all your
> technical problems via the Usenet. Is it working out the way you planned?

OTFL... Heheheh, yeah, kinda kookie.

We are a very small company. I am the only real employee, and I personally
have supplied all the funding (I often think of spike lee, who maxed out his
credit cards and went into hoc for his first movie...). My wife and I are in
debt up to our eyeballs :( but both believe in this project.

We've been lucky with our graphic artist. He'd done the job for 1/10 it's
actual value. However we've had a very hard time with the programmers. We
had a few who pretended to work, some who padded their resumes and had no
experience, and some who got halfway through and found something that pays
more....

Of the two programmers we have now, one has been fired, and the other, while
excellent, works full time at lucent. When he does give of his time, its on
much more serious issues.

I used to program in Pascal, and have spent the last 6 months learning
Java... I know relatively little, but am able to fix a few small bugs a day,
while our remaining programmer works on systemic issues. I post here because
he doesn't know the answer, and I need him working on the big stuff...

This is a very seat of your pants operation, though on the website we've
worked hard to hide that fact... It's got no budget, and has been very
difficult... But we're getting there... :)

Nick

"Raymond DeCampo" <rdecampo@spam-I-am-not.twcny.rr.com> wrote in message
news:YwbVb.48322$%72.39915@twister.nyroc.rr.com...
> BlackHawke wrote:
> > Our program, game program Andromeda Online (www.andromedaonline.net)
uses
> > two programs- one to play the game, another to patch the game as updates
> > come out. Players actually launch the updater which checks for fresh
> > updates, then installs them, then launches the game client.
> >
> > We have begun our beta test, and would like to have the client open with
a
> > console window so that players can see exceptions that are thrown. How
to do
> > this seems to be a question no-one can answer.
> >
> > A common misconception (as I understand it) is to use "javaw", but javaw
> > actually runs a program with no console. It's 'java' which will open a
> > command window to run in.
> >
> > So how do we get our update program to launch our client program in a
> > console window? This is the code we have now:
> >
> > public static void main(String args[]) {
> > UpdateFrame uf = new UpdateFrame();
> >
> > try {Process p =
> > Runtime.getRuntime().exec("java -Xmx64M -Xms64M -jar
AndromedaClient.jar");}
> > catch(Exception exc) {exc.printStackTrace(System.out);}
> >
> > uf.removeNotify();
> > uf.dispose();
> > }
> >
> > This successfully launches the client, but the client does not run in
> > console mode.
> >
> > Any help would be greatly appreciated.
> >
> > Nick Soutter
> >
>
> Nick,
>
> I'm going to assume a windows-specific solution is desired. That seems
> reasonable, since you mentioned javaw.
>
> I see a lot of stuff being thrown around in this thread, for example,
> trying to redirect standard output and error from Runtime.exec(). The
> reason that does not work is that in is actually the shell (cmd.exe or
> command.com) that does such things.
>
> You have a couple of options. You can replace the updater with a BAT
> file that launches the updater, waits for it to finish and then launches
> the client.
>
> Or you could change how the updater invokes the app. Try using
> something like:
>
> Runtime.exec("cmd /c java ...");
>
> You may need to put quotes around everything after the /c. If you are
> running on multiple Windows versions, use the value of the COMSPEC
> environment variable instead of hard coding "cmd". Also, you might have
> success by wrapping the java command inside a BAT file file. You will
> also want to look at the "start" command. (Start->Help and search for
> "start".)
>
> BTW, this is an interesting business model you have, solving all your
> technical problems via the Usenet. Is it working out the way you planned?
>
> Ray
>



Relevant Pages

  • Re: Execute Java in a new window
    ... > reason that does not work is that in is actually the shell (cmd.exe or ... > file that launches the updater, waits for it to finish and then launches ... Players actually launch the updater which checks for fresh ... >> updates, then installs them, then launches the game client. ...
    (comp.lang.java.help)
  • Re: Execute Java in a new window
    ... game program Andromeda Online uses ... > updates, then installs them, then launches the game client. ... You can replace the updater with a BAT ...
    (comp.lang.java.help)
  • Re: Execute Java in a new window
    ... game program Andromeda Online uses ... > updates, then installs them, then launches the game client. ... You can replace the updater with a BAT ...
    (comp.lang.java)
  • Re: Word COM object not marked as safe?
    ... "Rob Stewart" wrote in message ... > "An ActiveX control on this page might be unsafe to interact with other ... > Clicking Yes launches the Word doc, but I want to avoid this prompt ... > client will not allow this setting. ...
    (microsoft.public.scripting.jscript)
  • Word COM object not marked as safe?
    ... "An ActiveX control on this page might be unsafe to interact with other ... Clicking Yes launches the Word doc, but I want to avoid this prompt ... client will not allow this setting. ... referring to is the Word COM object, how can I mark it as 'safe'? ...
    (microsoft.public.scripting.jscript)