gpt4 book ai didi

java - launchd:管理 Java Jar

转载 作者:行者123 更新时间:2023-12-04 21:28:06 27 4
gpt4 key购买 nike

我有以下启动配置(存储在 acme.plist 中),我加载并开始使用 launchctl load acme.plistlaunchctl start acme.plist分别。

<?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.

但是从 bash 运行时我绝对没有问题。有任何想法吗?

最佳答案

您应该像这样更改配置:

<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar</string>
<string>/usr/local/acme/acme-latest.jar</string>
</array>

关于java - launchd:管理 Java Jar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32927956/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com