rossj
Posts: 16
Joined: Sun Jul 03, 2011 10:07 am

SplashScreen.getSplashScreen() returns null in JRE11

My application was working fine under JRE8. My code accesses the native splash screen in order to add some text and eventually close it. I'm currently upgrading to AdoptJDK11, but the SplashScreen.getSplashScreen() method just returns null so I can't control it. This is only a problem when my application is installed via AI. Running my application in the IDE (Eclipse) with the -splash VM option works fine (in JRE11). I'm using AI 16.6.1.

Can anyone shed some light on this...
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hello,

Could you please try to set the parameters used when running your application from Eclipse in "Java Products" page --> "Virtual Machine" tab --> "JVM Parameters" field and let me know if that helps?

For more information about this, please have a look over our "Edit Java Virtual Machine Parameters Dialog" article.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rossj
Posts: 16
Joined: Sun Jul 03, 2011 10:07 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hi Catalin,

Thanks for responding.

The only real difference between the VM args I use in Eclipse and those defined in the installer is the -splash:"<path>" option. I actually did try adding this explicitly to the installer (in the JVM Parameters field as you indicated) before posting to this forum. Unfortunately when I attempt to start the application, I receive a small pop-up dialog with the message "JNI exception: failed to create the Java VM Reason: Unknown.". Obviously the VM doesn't start and no logs are produced (or none that I could find). Is there a log file somewhere which elaborates on what an 'unknown' error might be?

Should the Advanced Installer splash screen support work in Java 11? Has this been verified?
Is my version of AI (16.6.1) compatible with JRE11? If not, what problem(s) might I experience?
Is there a way to tell if AI is even using the native spalshscreen support or it's own solution?

Cheers, Ross
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hello Ross,

I am really sorry to hear that it is still not working.

I have ran some tests on my end and it looked like everything is working as expected.

Here are the steps that I took:

- installed JRE8

- created a Java Project that displays a splash screen

- when running the application from Eclipse, I have provided the following parameters for the JVM:

Code: Select all

-splash:<path_to_gif> <name_of_class>
- I have then exported the project as a .JAR file

- created a sample Project in AI 17.8 --> everything worked as expected (the splash screen was correctly displayed)

- uninstalled JRE8

- installed AdoptOpenJDK11

https://adoptopenjdk.net/

- retested the above --> everything still worked as expected

- downloaded AI 16.6.1 to test the specific scenario. I have created a new project, added the .JAR, created the java product in "Java Products" page and pointed to my GIF in the "Splash Screen" field

- I have then installed the setup and after launching the executable, the splash screen was displayed

With that being said, I'd say this is not a problem regarding Advanced Installer's (16.6.1) support for JRE11.

Could you please take a look over the above steps and let me know if I am missing something?

Also, if possible, could you please create a sample project that reproduces this and forward me the resources (e.g. .AIP file + Eclipse Java Product + .JAR) by e-mail at support at advancedinstaller dot com?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rossj
Posts: 16
Joined: Sun Jul 03, 2011 10:07 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hi Catalin,

Thanks for your effort in trying to reproduce my problem. I think the key item you're missing is that I can get the splashscreen to appear, but Java can't gain access to it in order to modify and later remove it through the java.awt.SplashScreen.getSplashScreen() method.

I've created new Eclipse and AI projects which demonstrate the problem. I've not been able to attach the file as it's too big (2MB). So you can find it here... https://drive.google.com/file/d/1JyPlVz ... sp=sharing

In short, the Java project is set for JRE8 so it can be tested at 8 and above. the launch folder contains the launch config for running it in Eclipse. When everything works, the message 'I'M ALIVE!' should appear in red at the bottom right of the splashscreen. There is also a message sent to stderr indicating whether or not the spashscreen was found and visible.

When the AI project is built and a JRE8 (32bit) is used, everything is fine. When a JRE11 (32bit) is used, the splashscreen appears but is never updated with the text.

Cheers, Ross
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hello Ross,

Thank you very much for the provided resources.
When the AI project is built and a JRE8 (32bit) is used, everything is fine. When a JRE11 (32bit) is used, the splashscreen appears but is never updated with the text.
I have tested this and I was indeed able to reproduce the described behavior.

Unfortunately, I can not really say why this is happening.

I have forwarded this to our development team for further investigations and hopefully a fix will be available in a future version of Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rossj
Posts: 16
Joined: Sun Jul 03, 2011 10:07 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hi Catalin,
Thanks for making the effort to reproduce this and get it into the system. I will keep an eye open for a future fix... hopefully.
In the meantime, I'll just have to make do with a vanilla splashscreen, and rejig my code so the splashscreen closes automatically.
Cheers, Ross
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

You are always welcome, Ross!

I will update this thread as soon as this will be available in Advanced Installer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Hello Ross,

This has been fixed in version 18.0 of Advanced Installer, released on February 22nd, 2021.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rossj
Posts: 16
Joined: Sun Jul 03, 2011 10:07 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

Thanks Catalin, for prompt action and letting me know. We don't presently have an active maintenance agreement so will test this out at some point in the future when we do. Cheers, Ross
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: SplashScreen.getSplashScreen() returns null in JRE11

You are always welcome, Ross!

Always my pleasure to help.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”