如何使用 .ini 文件的参数命令行 .jar 文件?

How to command line a .jar file with arguments of an .ini file?

提问人:Benno Maul 提问时间:11/3/2023 更新时间:11/3/2023 访问量:14

问:

我想通过命令行启动一个 jar。我知道要设置 -D 和 -X 参数,但不知道该把库、vmargs 和 --add args 放在哪里。

提前感谢

当我启动以下命令行时

(
java -Xmx12g -Xms1G -Duser.language=en -Duser.country=US -Djava.net.preferIPv4Stack=true  -jar "plugins\org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar" --launcher.library plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.700.v20221108-1024 -vm plugins\org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_20.0.1.v20230425-1611\jre\bin -vmargs --add-exports=java.xml\com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED --add-exports=java.xml\com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED --add-modules=ALL-SYSTEM
)>log.txt

我收到以下错误

*** log.txt ***
An error has occurred. See the log file
\configuration\1698972072933.log.

*** \configuration\1698972072933.log ***
eclipse.buildId=unknown
java.version=1.8.0_371
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US

!ENTRY org.eclipse.equinox.simpleconfigurator 4 0 2023-11-03 01:41:13.585
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.equinox.simpleconfigurator [2]
  Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))"
*** .ini file ***
-startup
plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.700.v20221108-1024
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.minimal.stripped.win32.x86_64_20.0.1.v20230425-1611/jre/bin
-vmargs
--add-exports=java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED
-Duser.language=en
-Duser.country=US
-Djava.net.preferIPv4Stack=true
-Xms1G
-Xmx16G
--add-modules=ALL-SYSTEM
jar 命令 ini

评论


答: 暂无答案