Java Splash Argument Using File Inside Jar

So, I have a Splash.png file inside the package. I want to pass the argument -splash: splash.png when running the jar file, but I want the path to be directed to the internal package in the bank, and not outside where the jar actually works.

for example, I have a package called res, but when I do -splash:res/splash.png it will not show a splash

when I do -splash:splash.png and put the png file outside the jar file, it does not show a splash screen.

+4
source share
2 answers

Inside the jar, it appears that it should be specified through the manifest in the runnable jar.

 Manifest-Version: 1.0 Main-Class: <class name> SplashScreen-Image: <image name> 

See the section “How to use the JAR screen to display the splash screen” http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html

+2
source

/META-INF/MANIFEST.MF

JAR: image in package?

  • package theshow.jimmylandstudios.gui
  • img-path theshow / jimmylandstudios / gui

     Manifest-Version: 1.0 Class-Path: . Main-Class: theshow.jimmylandstudios.gui.GUI SplashScreen-Image: theshow/jimmylandstudios/gui/images/splash.png 
0
source

All Articles