Re: Execute Java in a new window
From: KC Wong (sterilize.the.spammers_at_killkillkill.com)
Date: 02/04/04
- Next message: Java: "Re: Java for really thick people?"
- Previous message: Percy: "Re: How to usee double Buffering to eliminate flicker"
- In reply to: BlackHawke: "Execute Java in a new window"
- Next in thread: BlackHawke: "Re: Execute Java in a new window"
- Reply: BlackHawke: "Re: Execute Java in a new window"
- Reply: BlackHawke: "Re: Execute Java in a new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 4 Feb 2004 17:37:22 +0800
> 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.
Why is using "javaw" a "misconception"?
It's better for the end-users... having a command window hanging around
might make them worried/uncomfortable, and they might close that command
window, terminating the Java app at the same time.
> 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.
I don't understand... what do you mean by "client does not run in console
mode"?
If your client app can be launched by "javaw", it can be launched by "java".
You can modify the command line to launch the client program to redirect the
standard error and standard output streams, e.g.
javaw {classname} > Log.txt 2>&1
That would redirect stderr to stdout, then stdout to Log.txt.
HTH,
KC
- Next message: Java: "Re: Java for really thick people?"
- Previous message: Percy: "Re: How to usee double Buffering to eliminate flicker"
- In reply to: BlackHawke: "Execute Java in a new window"
- Next in thread: BlackHawke: "Re: Execute Java in a new window"
- Reply: BlackHawke: "Re: Execute Java in a new window"
- Reply: BlackHawke: "Re: Execute Java in a new window"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|