Mac OS, Java Splash

I am trying to immigrate my Java application on Mac OS.
When the application starts, a splash screen appears.

When I launch the application from the terminal, it looks like this:
java -classpath /the/right/classpath/ -splash:images/splash.png myApp/Main
when I like it, a splash screen appears.

But when I associate the App with the   Jar Bundler , the splash screen does not appear.

on the Jar Bundler, on the properties tab, in VM Option I wrote:
splash:images/splash.png
I also tried:
-splash:images/splash.png(with a hyphen).
I noted the " Set the working directory to the domestic application package" .

i copy images/splash.pngto:

myApp.app/Contents myApp.app/Contents/Resources myApp.app/Contents/Resources/Java myApp.app/Contents/MacOS But the splash screen does not appear!

This is strange because myApp.app succeeds at launch - it just doesn't show a splash screen.

I found these two messages on the console:

February 11, 02:53:32 SnowL / Users / myusername / Desktop / myApp.app / Contents / MacOS / JavaApplicationStub [24262]: unrecognized Java VM option is ignored: -splash: images / splash.png

It is without a hyphen in front of the splash attribute.
February 11, 02:55:50 SnowL / Users / myusername / Desktop / myApp.app / Contents / MacOS / JavaApplicationStub [26314]: unrecognized Java VM option is ignored: splash: images / splash.png

, , , ?
VM, VM, ?
JVM ( Info.plist):
1,5 *
1,5+
1.6 *
1.6+
.

!

+3
4

Info.plist:

...
<key>Java</key>
    <dict>

    <key>MainClass</key>
    <string>...</string>

    <key>SplashFile</key>
    <string>$APP_PACKAGE/tmp_splash.png</string>
...
+6

:
Info.plist:

    ...
    <dict>
        <key>ClassPath</key>
        <string>$JAVAROOT/@PROJECTNAMEASIDENTIFIER@.jar:@CLASSPATH@</string>
        <key>JVMVersion</key>
        <string>1.6+</string>
        <key>MainClass</key>
        <string>@PROJECTMAINCLASS@</string>
        <key>SplashFile</key>
        <string>$JAVAROOT/splash.png</string>
    ...  

splash.png myapp.app/Contents/Resources/Java/splash.png
et voila.

+3

jFrame ,

+1

I had the same problem and I found a solution in this thread:

http://lists.apple.com/archives/java-dev/2008/Jun/msg00012.html

It includes adding an entry to the Info.plist file in the application bundle after using the Jar Bundler. In addition, the image must be copied to the file myApp.app/Contents/Resources/Java (at least with the option "set the working directory inside the application package"). Probably the best way, but it seems to work.

0
source

Source: https://habr.com/ru/post/1791367/


All Articles