3

Can anyone help me in either providing me some right direction towards using yajsw using java language to use java application as service or just provide me some basic code of hello world application which i can run as service. I googled it but could not find any thing useful.

Thanks in advance

Wearybands
  • 2,273
  • 8
  • 29
  • 50
  • 1
    possible duplicate of [How to create windows service from java jar?](http://stackoverflow.com/questions/1617458/how-to-create-windows-service-from-java-jar) – duffymo Feb 27 '13 at 12:23
  • Not exactly as your reference is to a different wrapper. – Nick Jun 04 '13 at 00:30

2 Answers2

4

YAJSW's documentation provides everything you need here. http://yajsw.sourceforge.net/

The easiest way to get running is to execute your jar with your own start script. Then you need to figure out what PID that java process is running as. Once you have the pid all you need to do is run either ./yajsw/yajsw##someversion##/bat/genConfig.bat or if your in linux run the ./yajsw/yajsw##someversion##/bin/genConfig.sh .

If successful this will create a wrapper.conf that is targeted towards your executable jar. This is plenty to get you going and off the ground. After that you can tweak the heck out of it for your own customizations.

The (genConfig.bat or genConfig.sh)'s argument is the PID. So run genConfig.bat #PID# !

PS: The config generator will add the classpath of each jar .. when it is easier just to add one classpath as wrapper.java.classpath.1 = .\lib\* instead.

Nick
  • 864
  • 8
  • 20
3

Ok, you can start by downloading JBoss 5.x and using this wrapper script I wrote to get it running. This serves just as an example for you. You would have to edit it to run whatever your application happens to be.

I also wrote a script for JBoss 7 servers.

djangofan
  • 25,461
  • 54
  • 171
  • 262