By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Execute Java in a new window

P: n/a
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
Jul 17 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
> 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
Jul 17 '05 #2

P: n/a
"BlackHawke" <bl********@legacygames.net> wrote in message news:<tS*******************@newsread2.news.pas.ear thlink.net>...
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.

[snipped..]
This doesn't answer your question directly, as put, but it does provide
a solution: have you considered just opening an AWT window with a TextArea
set to fixed width font, then appending your stuff onto the end of the
TextArea. It is possible to redirect System.err - so write a simple
'TextAreaPrintStream' class with the same interface, which 'outputs' to
a given TextArea.

This solution:
(a) is easier to use (it's awkward cutting/pasting from a MS-DOS window).
(b) supports better platform neutrality (platforms without shells?)
(c) does not require an exec() call to fork off a new java executable,
with all the associated issues that brings.
-FISH- ><>
Jul 17 '05 #3

P: n/a
nos

"FISH" <jo*****@merseymail.com> wrote in message
news:db*************************@posting.google.co m...
"BlackHawke" <bl********@legacygames.net> wrote in message

news:<tS*******************@newsread2.news.pas.ear thlink.net>...
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.

[snipped..]
This doesn't answer your question directly, as put, but it does provide
a solution: have you considered just opening an AWT window with a TextArea
set to fixed width font, then appending your stuff onto the end of the
TextArea. It is possible to redirect System.err - so write a simple
'TextAreaPrintStream' class with the same interface, which 'outputs' to
a given TextArea.

This solution:
(a) is easier to use (it's awkward cutting/pasting from a MS-DOS window).
(b) supports better platform neutrality (platforms without shells?)
(c) does not require an exec() call to fork off a new java executable,
with all the associated issues that brings.
-FISH- ><>


what about java console?
Jul 17 '05 #4

P: n/a
> Why is using "javaw" a "misconception"?

What I meant was I've had several people tell me "Oh, to open in a new
window, use javaw"... Apeares to me to be a comon misconception (even by
some advanced Java users). This is not what javaw does, and I wanted to head
off posts claming that that would work. It won't.

If your client app can be launched by "javaw", it can be launched by
"java".
If your client app can be launched by "javaw", it can be launched by "java".

Of course. The problem is that because we are launching the program from
another java program, a new console window doesn't open up. When the
original program ends, there are no console windows open....

The following code:

Runtime.getRuntime().exec("java -Xmx64M -Xms64M -jar AndromedaClient.jar");}

does not open the program "AndromedaClient.jar" in a console window. I don't
know why, but it doesn't. Aparently calling "java" from inside a running
java program (and not from a bat file, for example) does not cause a console
window to open. We need a console window, so I am wondering how to fix this.
javaw {classname} > Log.txt 2>&1


That's a good idea... It'll help, but we still need a console window. :(

Nick
Jul 17 '05 #5

P: n/a
We'd still need to call exec()...

The problem is the update program (which itself sometimes needs to patch)
can not patch itself (because it's running). Therefore we have two separate
programs:

The updater-
Updates the client
Updates the graphics
Updates the sounds
Updates config files

The Client
Updates the updater
Plays the game

In this method we can patch any and all files we need to, but this means one
program MUST launch another.

The problem is even using "java" in the exec() command, a new console window
doesn't open. :(

Nick
----- Original Message -----
From: "FISH" <jo*****@merseymail.com>
Newsgroups: comp.lang.java,comp.lang.java.help
Sent: Wednesday, February 04, 2004 4:01 AM
Subject: Re: Execute Java in a new window

"BlackHawke" <bl********@legacygames.net> wrote in message

news:<tS*******************@newsread2.news.pas.ear thlink.net>...
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.

[snipped..]
This doesn't answer your question directly, as put, but it does provide
a solution: have you considered just opening an AWT window with a TextArea
set to fixed width font, then appending your stuff onto the end of the
TextArea. It is possible to redirect System.err - so write a simple
'TextAreaPrintStream' class with the same interface, which 'outputs' to
a given TextArea.

This solution:
(a) is easier to use (it's awkward cutting/pasting from a MS-DOS window).
(b) supports better platform neutrality (platforms without shells?)
(c) does not require an exec() call to fork off a new java executable,
with all the associated issues that brings.
-FISH- ><>

Jul 17 '05 #6

P: n/a
Thank you for your log advice. Unfortunately it was unsuccessful.

When I used it from a command line (java -Xmx100M -Xms64M -jar
AndromedaClient.jar > Log.txt 2>&1), it worked beautifully.

However when I inserted it into the code:

try {Process p =
Runtime.getRuntime().exec("java -Xmx100M -Xms64M -jar AndromedaClient.jar >
Log.txt 2>&1");}

it failed to work.

My thought is it is tied to the fact that the above code fails to create a
console window. I am not sure, but our issue remains....

We need to launch a java program ("AndromedaClient.jar") from inside another
java program ("AndromedaOnline.jar"), and get either a console window for
the new program, or a log. Neither appears possible by any method we've
tried.

Nick

"KC Wong" <st********************@killkillkill.com> wrote in message
news:bv************@ID-200690.news.uni-berlin.de...
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

Jul 17 '05 #7

P: n/a
BlackHawke wrote:
Thank you for your log advice. Unfortunately it was unsuccessful.

When I used it from a command line (java -Xmx100M -Xms64M -jar
AndromedaClient.jar > Log.txt 2>&1), it worked beautifully.

However when I inserted it into the code:

try {Process p =
Runtime.getRuntime().exec("java -Xmx100M -Xms64M -jar AndromedaClient.jar >
Log.txt 2>&1");}

it failed to work.

You should try the exec() method that takes a String array - the command
to run and the arguments. I'm not sure that you will be able to do
redirection (>) with an exec().

--
---
MP3 Automagic CD Cover Creator (free Java app)
http://maccc.filenabber.com

Jul 17 '05 #8

P: n/a
Java Webstart can do the updating.
http://java.sun.com/products/javawebstart/

Your client program (whether you use your existing updater or Java webstart)
can catch the exceptions and use printStackTrace or getStackTrace to write
them to a file and to a text window (that you create).

You should be capturing the exceptions in the client program, not in the
updater.

Customers don't like looking at clunky console windows. They will iconize
it and ignore it.

If you capture exceptions, you can control what gets displayed in a dialog
(so they can't be ignored) and also log them to a file (and display it in a
your own code's text window if you want), you can at least look at their
error log when they report a problem (which *won't* be because they are
looking at the exceptions in the console, but *will* be because it doesn't
do what they expect or hangs etc).

"BlackHawke" <bl********@legacygames.net> wrote in message
news:xB******************@newsread1.news.pas.earth link.net...
We'd still need to call exec()...

The problem is the update program (which itself sometimes needs to patch)
can not patch itself (because it's running). Therefore we have two separate programs:

The updater-
Updates the client
Updates the graphics
Updates the sounds
Updates config files

The Client
Updates the updater
Plays the game

In this method we can patch any and all files we need to, but this means one program MUST launch another.

The problem is even using "java" in the exec() command, a new console window doesn't open. :(

Nick
----- Original Message -----
From: "FISH" <jo*****@merseymail.com>
Newsgroups: comp.lang.java,comp.lang.java.help
Sent: Wednesday, February 04, 2004 4:01 AM
Subject: Re: Execute Java in a new window

"BlackHawke" <bl********@legacygames.net> wrote in message

news:<tS*******************@newsread2.news.pas.ear thlink.net>...
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.

[snipped..]
This doesn't answer your question directly, as put, but it does provide
a solution: have you considered just opening an AWT window with a TextArea set to fixed width font, then appending your stuff onto the end of the
TextArea. It is possible to redirect System.err - so write a simple
'TextAreaPrintStream' class with the same interface, which 'outputs' to
a given TextArea.

This solution:
(a) is easier to use (it's awkward cutting/pasting from a MS-DOS window). (b) supports better platform neutrality (platforms without shells?)
(c) does not require an exec() call to fork off a new java executable,
with all the associated issues that brings.
-FISH- ><>


Jul 17 '05 #9

P: n/a
I think I see what your problem is.

When you launch a program using Runtime.exec(), its standard input,
standard output, and standard error streams are redirected; they are piped
to the launching progarme which can access the via methods getInputStream()
etc. of class java.lang.Process. Therefore the "launchee" doesn't need a
console; as far as it is concerned, the "launchor" _is_ its console.

To create the effect of a console, e.g. to have System.out write to
somewhere the user can see, you'll need to do one of two things:
1. Instead of launching the program itself, launch a terminal and tell it
to run the program. How you do this is system dependent: e.g. on Unix you
could use xterm -e <program>, on Windows or PalmOS you probably do
something completely different.
2. Launch the program, grab its standard output from the Process object,
read everything which comes down the pipe and display it in a TextArea or
something. You can do the same (in reverse) for standard input if you like.

Make sense?

--
Chris Gray ch***@kiffer.eunet.be
/k/ Embedded Java Solutions

Jul 17 '05 #10

P: n/a
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

Jul 17 '05 #11

P: n/a
Thank you tom, however I think you may have misunderstood.

1) We are trying to capture exceptions in the client program, not the
updater. The problem is the updater can not be made to open a console for
catching exceptions.

2) I'll have to look at printStackTrace, that may work well...
Customers don't like looking at clunky console windows. They will iconize
it and ignore it.
We are in beta. We have beta testers. This is for extreem situations where
we want a log of catastrophic errors. The console runs behind the program
(which is full screen) and out of their way, and we would not have a console
for the commercial release.

Thanks!

Nick
"Tom N" <to*@nospam.au> wrote in message
news:W9*****************@news-server.bigpond.net.au... Java Webstart can do the updating.
http://java.sun.com/products/javawebstart/

Your client program (whether you use your existing updater or Java webstart) can catch the exceptions and use printStackTrace or getStackTrace to write
them to a file and to a text window (that you create).

You should be capturing the exceptions in the client program, not in the
updater.

Customers don't like looking at clunky console windows. They will iconize
it and ignore it.

If you capture exceptions, you can control what gets displayed in a dialog
(so they can't be ignored) and also log them to a file (and display it in a your own code's text window if you want), you can at least look at their
error log when they report a problem (which *won't* be because they are
looking at the exceptions in the console, but *will* be because it doesn't
do what they expect or hangs etc).

"BlackHawke" <bl********@legacygames.net> wrote in message
news:xB******************@newsread1.news.pas.earth link.net...
We'd still need to call exec()...

The problem is the update program (which itself sometimes needs to patch)
can not patch itself (because it's running). Therefore we have two

separate
programs:

The updater-
Updates the client
Updates the graphics
Updates the sounds
Updates config files

The Client
Updates the updater
Plays the game

In this method we can patch any and all files we need to, but this means

one
program MUST launch another.

The problem is even using "java" in the exec() command, a new console

window
doesn't open. :(

Nick
----- Original Message -----
From: "FISH" <jo*****@merseymail.com>
Newsgroups: comp.lang.java,comp.lang.java.help
Sent: Wednesday, February 04, 2004 4:01 AM
Subject: Re: Execute Java in a new window

"BlackHawke" <bl********@legacygames.net> wrote in message

news:<tS*******************@newsread2.news.pas.ear thlink.net>...
> 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.
[snipped..]
This doesn't answer your question directly, as put, but it does provide a solution: have you considered just opening an AWT window with a TextArea set to fixed width font, then appending your stuff onto the end of the
TextArea. It is possible to redirect System.err - so write a simple
'TextAreaPrintStream' class with the same interface, which 'outputs' to a given TextArea.

This solution:
(a) is easier to use (it's awkward cutting/pasting from a MS-DOS window). (b) supports better platform neutrality (platforms without shells?)
(c) does not require an exec() call to fork off a new java executable,
with all the associated issues that brings.
-FISH- ><>



Jul 17 '05 #12

P: n/a
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" <rd******@spam-I-am-not.twcny.rr.com> wrote in message
news:Yw*******************@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

Jul 17 '05 #13

P: n/a
"BlackHawke" wrote:
Thank you tom, however I think you may have misunderstood.

1) We are trying to capture exceptions in the client program, not the
updater. The problem is the updater can not be made to open a console for
catching exceptions.
I understand all right. The problem you describe above is not a problem
statement - it is a difficulty you experienced with one solution you have
tried. The problem is that you want a history of exceptions available when
the user ultimately experiences a problem.

I have been there and done that with a Java Swing application. My customers
didn't like the console and they ignored it. They were reasonably computer
savvy and still they took no notice of exceptions displayed in the console.
By the time they called us over to help (and we were only 20 feet away), the
relevant info had usually disappeared from the console.

It was much more useful when we changed the code to log the exceptions to a
file and where relevant, post a dialog. We could then get the log file off
their PC and figure out what was wrong because it had much more history in
it and they knew something bad had happened earlier on. You can also log
significant events in the execution of the program (for example, what major
commands the user invoked) so you know in what major area of the code the
problem occurred.

I understand that you just want a quick kludgey fix that only works on
Windows as described elsewhere on the thread. Just so long as you are aware
that it is a quick kludgey fix that only works on Windows.

There is nothing to stop you doing capturing exceptions in the client
program, by the way. The only reason that Swing programs keep going when
exceptions occur is that there is a default Swing exception handler that
does a printStackTrace. If there was no handler, the prog would probably
exit. So the fact that Swing catches exceptions is no different to if your
code does it.
2) I'll have to look at printStackTrace, that may work well...
Customers don't like looking at clunky console windows. They will iconize
it and ignore it.
We are in beta. We have beta testers. This is for extreem situations where
we want a log of catastrophic errors. The console runs behind the program
(which is full screen) and out of their way, and we would not have a

console for the commercial release.

Thanks!

Nick
"Tom N" <to*@nospam.au> wrote in message
news:W9*****************@news-server.bigpond.net.au...
Java Webstart can do the updating.
http://java.sun.com/products/javawebstart/

Your client program (whether you use your existing updater or Java webstart)
can catch the exceptions and use printStackTrace or getStackTrace to write them to a file and to a text window (that you create).

You should be capturing the exceptions in the client program, not in the
updater.

Customers don't like looking at clunky console windows. They will iconize it and ignore it.

If you capture exceptions, you can control what gets displayed in a dialog (so they can't be ignored) and also log them to a file (and display it in a
your own code's text window if you want), you can at least look at their
error log when they report a problem (which *won't* be because they are
looking at the exceptions in the console, but *will* be because it

doesn't do what they expect or hangs etc).

"BlackHawke" <bl********@legacygames.net> wrote in message
news:xB******************@newsread1.news.pas.earth link.net...
We'd still need to call exec()...

The problem is the update program (which itself sometimes needs to patch) can not patch itself (because it's running). Therefore we have two

separate
programs:

The updater-
Updates the client
Updates the graphics
Updates the sounds
Updates config files

The Client
Updates the updater
Plays the game

In this method we can patch any and all files we need to, but this means one
program MUST launch another.

The problem is even using "java" in the exec() command, a new console

window
doesn't open. :(

Nick
----- Original Message -----
From: "FISH" <jo*****@merseymail.com>
Newsgroups: comp.lang.java,comp.lang.java.help
Sent: Wednesday, February 04, 2004 4:01 AM
Subject: Re: Execute Java in a new window
> "BlackHawke" <bl********@legacygames.net> wrote in message
news:<tS*******************@newsread2.news.pas.ear thlink.net>...
> > 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.
> [snipped..]
>
>
> This doesn't answer your question directly, as put, but it does

provide > a solution: have you considered just opening an AWT window with a

TextArea
> set to fixed width font, then appending your stuff onto the end of the > TextArea. It is possible to redirect System.err - so write a simple
> 'TextAreaPrintStream' class with the same interface, which 'outputs' to > a given TextArea.
>
> This solution:
> (a) is easier to use (it's awkward cutting/pasting from a MS-DOS

window).
> (b) supports better platform neutrality (platforms without shells?)
> (c) does not require an exec() call to fork off a new java executable, > with all the associated issues that brings.
>
>
> -FISH- ><>



Jul 17 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.