How to wrap your java application as a window service running with OpenJDK via Apache Procrun

How to wrap your java application as a window service running with OpenJDK via Apache Procrun
Photo by Ali Kazal / Unsplash

while I tried to follow https://commons.apache.org/proper/commons-daemon/procrun.html?ref=post-code-and-quiet-time to set up my java application as a window service, I encountered 2 issues:

  • can't find client/jvm.dll in the JDK downloaded(you can find where to download via this link)
  • try to use server/jvm.dll found in the JDK jre/bin folder, but not able to start
loading jvm 'C:\Program Files\jvm\jre\bin\client\jvm.dll'
%1 is not a valid win32 application

Solution: Downgrade your JDK to x32

so it looks like the procrun.exe is expected a x32 jvm.dll.

Not all x32 JDK has client/jvm.dll, I found one works.
here is the download link: https://adoptium.net/temurin/releases/?version=8

use procrun-64.exe

the below link might work. use procrun 64bit exe can work with JDK 64bit version. JDK 64bit version usually has it jvm.dll under jre/bin/server/jvm.dll.

Index of /commons/daemon/binaries/windows

References

https://forums.oracle.com/ords/apexds/post/client-jvm-dll-vs-server-jvm-dll-4735

Subscribe to Post, Code and Quiet Time.

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe