gpt4 book ai didi

java - 在 Windows 启动时运行 Java 应用程序

转载 作者:行者123 更新时间:2023-12-01 18:11:19 25 4
gpt4 key购买 nike

我有一个包含 Java 应用程序的 JAR 文件。如何让它从 Windows 启动,而不需要用户交互?

最佳答案

创建一个 .bat 文件并将其放入其中:

javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar

然后将.bat文件放入Windows启动文件夹中。

One more thing: There's a difference between using java and javaw. While java is better when you are debugging an application, the application prints text or something like that, javaw is better when you don't need that. Why? Because java runs java program using a console that shows all that application prints (println's, exception stacktraces and so on) while javaw doesn't run on console.

关于java - 在 Windows 启动时运行 Java 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60465239/

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