使用 eclipse 调试项目时使用清单文件

发布于 2024-10-15 09:06:09 字数 470 浏览 4 评论 0原文

我正在使用 java 和 Eclipse,并且我想创建一个启动屏幕。 我发现这个例子非常好: http://download.oracle .com/javase/tutorial/uiswing/misc/splashscreen.html

但这意味着使用清单文件。如果我将项目导出到 jar 文件然后运行它,我可以让它运行,但我想在 Eclipse 中调试它,因为它的行为很奇怪。

有什么方法可以创建清单,添加到我的项目中,并告诉 Eclipse 在每次单击“调试”按钮时使用该清单?

ps:我已经在这里看到一个帖子,其中有人推荐了 ant 文件。这个ant文件生成一个jar,但是当我在Eclipse中单击“调试”时,它没有被调用。

谢谢, 奥斯卡

I am using java and Eclipse, and I want to create a Splashscreen.
I found this example, which is very nice: http://download.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html

But it means using a manifest file. I could get it to run if I export the project to a jar file and then run it, but I would like to debug it in Eclipse because it is behaving strangely.

Is there any way that I can create an Manifest, add to my project and tell Eclipse to use that manifest every time I click in the Debug button?

ps: I have already seen a thread here where someone recommended am ant file. This ant file generates a jar, but it is not called when I click on "Debug" in Eclipse.

Thanks,
Oscar

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

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

发布评论

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

评论(1

淡淡绿茶香 2024-10-22 09:06:09

重新阅读您链接到的教程页面:答案就在那里:

要从命令行显示启动屏幕,请使用 -splash: 命令行参数。此参数是显示启动屏幕的 Java 应用程序启动器选项:

java -splash:<file name> <class name>

因此您只需在 Eclipse 中编辑调试配置并添加 -splash: 参数

Re-read the tutorial page you linked to : the answer is in there :

To display a splash screen from the command line use the -splash: command-line argument. This argument is a Java application launcher option that displays a splash screen:

java -splash:<file name> <class name>

So you just have to edit your debug configuration in Eclipse and add the -splash: argument

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