How to create Java daemon in Centos
===

I made a research how to create Java daemon which can run on Centos. I found that there is a two ways:

1. Using C code to start the daemon [example][1] [example][2].
2. Pure java daemon with init scripts [example][3].

Which one to choose. I prefer the pure Java solution. Would you share some experience?


  [1]: http://commons.apache.org/daemon/
  [2]: http://stackoverflow.com/questions/1311268/tool-for-creating-a-java-daemon-service-on-linux
  [3]: http://barelyenough.org/blog/2005/03/java-daemon/