2
我有以下launchd配置(存儲在acme.plist
),我加載並分別開始使用launchctl load acme.plist
和launchctl start acme.plist
。launchd:管理Java Jar
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.acme</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar /usr/local/acme/acme-latest.jar</string>
</array>
<key>StandardErrorPath</key>
<string>/tmp/acme-error</string>
</dict>
</plist>
每當我嘗試運行它,我得到/tmp/acme-error
如下:
Unrecognized option: -jar /usr/local/acme/acme-latest.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
然而,從慶典上運行時我絕對沒有問題。有任何想法嗎?