使用快捷方式时 Java 启动屏幕不工作

发布于 2024-12-08 16:17:30 字数 192 浏览 4 评论 0原文

我已经使用 Launch4j 从 jar 文件创建了一个 exe。我有一个 png 格式的启动屏幕,它是使用参数 -Splash:logo.png 加载执行的。

当我执行 exe 文件时,它可以正常工作。但如果我从快捷方式执行程序,它就不起作用(我的意思是启动图像,程序的其余部分工作正常)。

为什么会出现这种情况?我该如何解决这个问题?

I have created an exe from my jar file with Launch4j. I have a splash screen in png which is loaded executing with the parameter -Splash:logo.png

When I execute the exe file, it works properly. But if I execute the program from a shortcut, it doesn't work (I mean the splash image, the rest of the program works ok).

Why does this happen? How can I fix this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁的新欢旧爱 2024-12-15 16:17:30

在快捷方式中设置您的工作目录。

快捷方式属性之一应为“开始于”或“工作目录”。确保将其设置为快捷方式所在的同一目录。当您双击 exe 来启动它时,这会自动发生。当您创建快捷方式时,可以将其设置为任何内容。

这里的问题不在于快捷方式丢失参数。这是不可能的,因为它被编译成exe文件。这里的问题是应用程序找不到 logo.png,它应该位于工作目录的子文件夹中。

Set your working directory in the shortcut.

One of the shortcut properties should say "Start in" or "Working directory". Make sure that you have this set to the same directory that the shortcut is in. When you double-click on the exe to start it, this happens automatically. When you create a shortcut, this could be set to anything.

The problem here isn't that the shortcut is losing the parameter. This is impossible since it's compiled into the exe file. The problem here is that the application cannot find logo.png, which it is expecting to be in a subfolder of the working directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文