On Wed, 2003-10-01 at 23:11, shah tushar wrote:
I am not expert in java but here is my solution that works.
Basically you can look into how tomcat startup scripts are written
to get more idea.
Code at org.apache.catalina.startup.Bootstrap maybe of some help to you.
>     Can anybody point me to a generic solution for
> daemonizing a java application natively  (So that it
> can daemonize on any platform without any additional
> stuff like daemontools ) 
Not really, "natively on any platform" is a bit of oxymoron when
speaking of java.
>  Also How can I make binaries out of a java file ?
In Linux all you need to do is create a elf binary coded in C as in
ecliple--a java IDE
(
$file eclipse 
eclipse: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
)  

or a shell script( an init like script with support for chkconfig )
that spawns the java application(setting up the required classpath and
other environment for it) . 
Only catch is that it is not a cross platform way.
Earlier there used to be a Kernel module + system hack for running java
applications "natively" on linux( basically calling the jvm for a 
.class executable marked file --don't know whether its still there)

A similar hack is usually/actually used "daemonize" natively a java
application in [EMAIL PROTECTED] like platforms as a native service.
The shell script way is way to go in linux.

Hope that helps.
-Tarun Dua
http://www.tarundua.net
Nothing you ever wanted to find about Tarun Dua


_______________________________________________
ilugd mailing list
[EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to