• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java program terminates  RSS feed

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a java program that will run infinitely

In the code I added for(;;)

But when I start program in the unix machine using JAVA classname command from PUTTY session it’s started running. As soon as I close the Putty session the program is terminated.
We are expecting the java program to run even after closing the PUTTY session.

Whether the fork command will help ?

Please assist us
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with Java. Unix will terminate your shell and its subprocesses when you terminate the connection.
Use background execution (someCommand &), fg and bg, or the program called screen that can give you sessions in virtual terminals. Or run your Java code as a service (jWrapper, YAJSW).
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or nohup.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!