Hi Marcus,

You can do the following (with bash):

   java packageName.className 2>&1 > fileName

And then do a

   ps ...|awk ...|grep ...|wc -l

after a sleep with a grep perhaps? Or you can have your program create
some kind of lock file. In the latter case you first delete the lock
file, then start the Java program and then check whether the file exists
with a time out or so.

My 2cts :)

Ernst


[EMAIL PROTECTED] wrote:
> 
> Dear List,
> I have written a little program that I would like to run in the background.
> 
> My linux box is Linux 6.1.
> JDK 1.1.7b from blackdown.
> 
> I know to put 2>&1 & at the end of the starting line, but when I do a
> System.out.println it prints to the window as expected. Can I detect, when
> the java app is running whether it has been started in the background? So I
> can skip the writing.
> 
> Cheers,
> Marcus
> 
> ------------------------
> Marcus Monaghan
> BOOT Computers Limited
> Tel : 01270 611299
> Fax : 01270 611302
> ------------------------
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

--
Ernst de Haan
Freelance Java Architect

"Come to me all who are weary and burdened,
and I will give you rest" -- Jesus Christ


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to