On Unix and GNU / Linux systems, you can run the program using nohup , like this, assuming it's a jar:
nohup java -jar program.jar &
To get the program output to a text file, so that later you can view it, you can do:
nohup java -jar program.jar > program.log &
There are packages that will port your Java programs to services , which is more manageable than bare java processes.
You might also want to use the wrapper " ( Launch4J , maybe?) To give your process a meaningful name, otherwise all your Java programs will appear as java in the process list, which is not very significant.
source share