[Unit] Description=Java camera service After= [Service] WorkingDirectory=/home/app/java Environment="LD_LIBRARY_PATH=/home/app/java/lib" ExecStart=/opt/java8/bin/java -jar /home/app/java/ Restart=no User=Admin RestartSec=30 StandardOutput=append:/home/app/java/ StandardError=append:/home/app/java/ Type=simple [Install] WantedBy=
WorkingDirectory: replace it with the location of your jar.
Environment: the environment on which the jar package should be started, if you have it, add it, if not, don't add it.
ExecStart: Specify the location of your jar package from the jdk's bin directory
Restart: Setting the restart method
User: the role that uses the device
RestartSec: how many times to restart the
StandardOutput, StandardError: Set the log location.
-
@echo off javaw -jar "D:\app\"