Mac OS,Java Splash [英] Mac OS, Java Splash
问题描述
我正在尝试将我的Java应用程序移植到Mac OS。
当应用程序启动时,应该出现启动画面。
I'm trying to immigrate my Java application to Mac OS.
When the application start, splash screen supposed to appear.
我从终端运行应用程序它是这样的:
java -classpath / the / right / classpath / -splash:images / splash.png myApp / Main
当我这样做时会出现闪屏。
When i running the App from the terminal it go like this:
java -classpath /the/right/classpath/ -splash:images/splash.png myApp/Main
when i do like this the splash screen appears.
但当我将应用程序与
捆绑在一起 Jar Bundler ,不会出现闪屏。
But when i bundle the App with the Jar Bundler, the splash screen does not appear.
在Jar Bundler上,在属性选项卡下,在我写的VM选项中:
splash:images / splash.png
我也尝试过:
-splash:images / splash.png
(连字符)。
我标记了选项 Set工作目录到内部应用程序包。
on the Jar Bundler, under the properties tab, in the VM Option i wrote:
splash:images/splash.png
I also tried:
-splash:images/splash.png
(with hyphen).
I marked the option "Set Working Directory To Inside Application Package" as well.
我复制 images / splash.png
发送至:
但是启动画面拒绝出现!
i copy the images/splash.png
to :
这很奇怪,因为myApp.app成功运行 - 它只是没有显示启动画面。
It's strange because the myApp.app succeed to run - it just not show the splash screen.
我在控制台找到了这个wo消息:
I found at the console this two messages:
Feb 11 02:53:32 SnowL /Users/myusername/Desktop/myApp.app/Contents/MacOS/JavaApplicationStub[24262]:忽略无法识别的Java VM选项:-splash :images / splash.png
Feb 11 02:53:32 SnowL /Users/myusername/Desktop/myApp.app/Contents/MacOS/JavaApplicationStub[24262]: Unrecognized Java VM option ignored: -splash:images/splash.png
这在splash属性之前没有连字符。
This without hyphen before the splash attribute.
Feb 11 02:55: 50 SnowL /Users/myusername/Desktop/myApp.app/Contents/MacOS/JavaApplicationStub [26314]:忽略无法识别的Java VM选项:splash:images / splash.png
Feb 11 02:55:50 SnowL /Users/myusername/Desktop/myApp.app/Contents/MacOS/JavaApplicationStub[26314]: Unrecognized Java VM option ignored: splash:images/splash.png
当我从终端运行应用程序时,如果它可以显示启动画面,
但双击应用程序不会显示启动画面?
它应该像终端虚拟机一样运行在同一个虚拟机上,不是吗?
我还将JVM版本(在Info.plist文件中)更改为:
1.5 *
1.5+
1.6 *
1.6+
它们都不会出现闪屏。
How it can by that when i run the app from the terminal the splash screen appear,
but double click on the App does not show the splash screen?
it supposed to run on the same VM like the terminal VM, doesn't it?
I olso change the JVM version (on the Info.plist file) to:
1.5*
1.5+
1.6*
1.6+
none of them make the splash screen to appear.
感谢您的帮助!
推荐答案
像这样,在你的Info.plist中:
Like this, in your Info.plist:
...
<key>Java</key>
<dict>
<key>MainClass</key>
<string>...</string>
<key>SplashFile</key>
<string>$APP_PACKAGE/tmp_splash.png</string>
...
这篇关于Mac OS,Java Splash的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!