Java splash screen not working when using a shortcut
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 properl开发者_开发知识库y. 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?
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.
精彩评论