Returning Control to the Command Line (like a daemon)

Hi all,

I looked through about 20 of the messages on the forum about daemons, but none of them seemed to address my specific question, which is, I would like to run my java class from the command line, have the main thread start up several other threads, and then have the main thread exit in such a way that it returns me to the command line and works in the background.

Now, I don't even know this is possible, from what I know of Threads, the JVM is going to continue as long as those background threads are processing... but any one have a suggestion to help me get my overall goal?

Kenny

[618 byte] By [kennysmith] at [2007-9-27 16:49:22]
# 1

> Hi all,

>

> I looked through about 20 of the messages on the forum

> about daemons, but none of them seemed to address my

> specific question, which is, I would like to run my

> java class from the command line, have the main thread

> start up several other threads, and then have the main

> thread exit in such a way that it returns me to the

> command line and works in the background.

>

That is part of the OS and the command shell that you use.

> Now, I don't even know this is possible, from what I

> know of Threads, the JVM is going to continue as long

> as those background threads are processing... but any

> one have a suggestion to help me get my overall goal?

If you are creating a java thread then a JVM will always have to be running. So there is no possible way for the JVM to exit.

jschell at 2007-7-6 1:07:17 > top of Java-index,Archived Forums,Java Programming...