B4J Question Java as Windows Service

pesquera

Active Member
Licensed User
Hi,
Can somebody recommend to me some way to run a java program as a Windows/ service?
It's a java (jar) server program, running fine into a windows' console.. now, it's required to be always on line..
Thanks in advance
 

tchart

Well-Known Member
Licensed User
Just to add I tried several other service wrappers (some mentioned on this forum) but found JavaService the most reliable and easy to use.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Ok, I've put it on Dropbox;

https://dl.dropboxusercontent.com/u/29310440/javaservice_x64.zip

The zip file contains the x64 version of JavaService.exe, msvcr100.dll (required for JavaService.exe) and two batch files.

The two batch files are to install and uninstall the service you will need to tweak these with your config. Note the batch file sets the service to "Manual" so you may want to change that to automatic.

The JAR file needs to be in the same directory as the other JavaService files.

Most important tips are to make sure you point at the correct JVM.dll file (ie 64bit) and also name your start entry point correctly with your package name plus ".main"

eg; -start com.mypackage.main

If you mix bits (ie 32bit JVM with 64 bit JavaService) it will not work. Also if the package name is wrong it will not work.
 
Last edited:
Upvote 0

OliverA

Expert
Licensed User
Upvote 0
Top