Posts

Showing posts from February, 2023

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

Image
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 t  

Where you can download OpenJDK?

Image
Here you are: Latest Releases | AdoptiumEclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.AdoptiumOpenJDK Downloads | Download Java JDK 8 & 11 | OpenLogicOpenLogic provides free OpenJDK Java downloads for OpenJDK 8 and OpenJDK 11. Get your JDK download today. Plus, get answers to your FAQ about Java development and download Java JDK 8 and Java 11.OpenLogic  

How to wrap your java backend app as a Window service?

Image
Procrun is a set of applications that allow Windows users to wrap (mostly) Java applications (e.g. Tomcat) as a Windows service. Bundle below Power Shell(ps1) files into your app's jar file InstallYourService.ps1 .\prunsrv.exe //IS//YourService --DisplayName="YourService" --Description="YourService" --Startup=auto --Install="c:\Program Files\yourservice\bin\prunsrv.exe" --Jvm="c:\Program Files\yourjvm\jvm.dll" --Classpath="c:\Program Files\yourservice\lib\yourserver-xx.x.jar" --StartMode=  

How to adding classes to the JAR File's Classpath in a Maven sprint boot app?

Image
When using Maven, if we want to rely on a local jar package, we usually use <scope>system</scope> and  <systemPath>{yourlibpath}</systemPath> to handle it. By using the Class-Path header in the manifest, you can avoid having to specify a long -classpath flag when invoking Java to run your application. But if you just do the above, when you use the SpringBoot packaging plugin to generate a jar package, you will find that the jar package will not be typed in, and an error will occur. The error u