Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6785037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:04:31+00:00 2026-05-26T17:04:31+00:00

I have search all over the web but could not find answer to this

  • 0

I have search all over the web but could not find answer to this question:

I need to debug the functioning of an application that changes the SplashScreen based on the module you are accessing.

I do know that the code:

SplashScreen splash = SplashScreen.getSplashScreen();

Can be used to get the instance when you pass either:

  • Splash from command line: java -splash:path/image.gif ClassFile
  • Splash image in manifest: splashscreen-image: img/SplashNomina.gif

Still when I tried to run the application by passing the -splash value from VM args in Eclipse it did not work.

Is it actually possible as SplashScreen.getSplashScreen() is always NULL.
I have been trying passing without success:

  • -splash:image.gif
  • -Dsplash=image.gif

Right now I see lots of limitations in this Splash api, as it is always required to have a parameter being passed. I think it would be much more flexible to be able to just pass the parameter at runtime 🙁

Any help woult be really appreciated!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:04:32+00:00Added an answer on May 26, 2026 at 5:04 pm

    OK, this has bitten me too.

    I built a runnable jar
    with manifest entry

    SplashScreen-Image: MyGraphic.jpg
    

    and it works as it’s supposed to.

    From Eclipse, specifying the VM arg as

    -splash:MyGraphic.jpg
    

    no such luck

    SplashScreen.getSplashScreen() returns null.

    The reason for this is the brain-dead implementation of SplashScreen.getSplashScreen() in the JDK (at least 1.6). I think. It’s kind of hard to tell without getting into what the native code is doing. But, here is this method from java.awt.SplashScreen. I’m not sure if it’s called but studying it did provide me with the essential clue I needed to get this working in Eclipse:

    public synchronized URL getImageURL() throws IllegalStateException {
        checkVisible();
        if (imageURL == null) {
            try {
                String fileName = _getImageFileName(splashPtr);
                String jarName = _getImageJarName(splashPtr);
                if (fileName != null) {
                    if (jarName != null) {
                        imageURL = new URL("jar:"+(new File(jarName).toURL().toString())+"!/"+fileName);
                    } else {
                        imageURL = new File(fileName).toURL();
                    }
                }
            }
            catch(java.net.MalformedURLException e) {
                // we'll just return null in this case
            }
        }
        return imageURL;
    }
    

    Note that in the case of a file (i.e. command-line rather than jar launch) it’s not doing a getResource() to get the URL but opening a file relative to the CWD. Since Eclipse run configurations default to running from the root of the project, the answer is to specify the path as a relative path and not to expect a classpath lookup.

    Therefore, since I am building with maven, my image is located at src/main/resources/MyGraphic.jpg. Specifying this as the command line parameter: i.e.

    -splash:src/main/resources/MyGraphic.jpg 
    

    allows it to work in Eclipse (or, I guess, any command line)

    I’m not sure WHY this is, since the getImageURL method is NOT called by getSplashScreen() but it DOES work.

    To me this is kind of brain-dead on the part of Sun/Oracle. They could have easily done a classpath lookup with something like
    imageURL = getResource(filename) but they did not.

    The short answer is that the Splash Screen command line syntax refers to a filename relative to the current working direrctory, not relative to the classpath.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have search all over the web, but unable to find an answer, so
I have search all over Stack Overflow site but I can find an answer
I have been search all over the net and couldn't find an appropriate solution
Ok, so I swear this question should be all over the place, but its
ok I've search all over the web for a solution to this. I'm a
I need all records which have year entered from search criteria. for ex: String
I've looked all over the web only to find ways to make searches insensitive
I know this is the type of question that I can easily find all
I have Five check boxes Search All Template 1 Template 2 Template 3 Template
I have an array returned by the function Search.all : => [#<Search id: 7,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.