Java applications require some tweaking to work under FireDaemon Pro. All Java applications will run successfully under FireDaemon Pro providing the following rules are observed:
- Don't Run out of Batch File; Run java.exe Directly
FireDaemon Pro is all ready to support any Java application that is traditionally launched via a batch file. We don't recommend you use batch files because FireDaemon Pro has no access to the java.exe executable and cannot detect JVM crashes.
- Mandatory: Use The -Xrs Flag
When running your Java application (assuming you have a JVM >= 1.4.x) ensure you pass the -Xrs flag as one of the parameters. This will stop the JVM terminating when you log off. For example:
Executable: C:\Program Files\Java\jre1.8.0_261\bin\java.exe
Parameters: -Xrs -D... -jar jarfile
You can find a complete list of Java options here.
- Set The Correct Job Type
If you absolutely have to run out of a batch file, ensure your Job Type (Advanced tab, General section) is set to Global Job. Any processes instantiated by your batch file will be placed in a Job Group and terminated when the service is terminated, hence avoiding any process orphaning.
- Use javaw.exe
java.exe associates itself with a console. If you run interactive Java applications under FireDaemon Pro you will see the java.exe process in a separate black "console" box. Use javaw.exe instead to correct this problem. Also, make sure Console Application is NOT checked.
Most Java applications run fine when run as the default user under FireDaemon Pro (LocalSystem). However, if you need access to mapped drives, specific network shares and other resources you might need to run the application as a different user. To change the user the service is run as, see the Logon section in the Settings tab. For more information about service user accounts see this FAQ. Information about how to map network drives can be found here.