-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace native splash with Java implementation #53
Conversation
This removes the native implementation that was hard to maintain in the past and wasn't working properly in some cases. In addition, changes to how libsplashscreen is linked starting with Java 9 has made using libjvm basically impossible. The new Java implementation offers a progress bar during startup which is currently static. Future versions could improve on this and make the startup even more verbose s.t. we can get more information on where it grinds to a halt / an issue appears.
2090b61
to
1d71f9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for finalizing this, @stelfrich! Requested some minor changes.
Did you do much testing of non-headless CLI scenarios, to ensure they still don't splash?
pom.xml
Outdated
@@ -129,7 +129,7 @@ Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck | |||
Institute of Molecular Cell Biology and Genetics.</license.copyrightOwners> | |||
<license.projectName>ImageJ software for multidimensional image processing and analysis.</license.projectName> | |||
|
|||
<scijava.jvm.version>1.6</scijava.jvm.version> | |||
<scijava.jvm.version>1.8</scijava.jvm.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? (If we do need this: we can just remove this line, rather than changing it, since 1.8 is the default these days.)
Edit: Oh, it was for the lambda below. I think we should change the code not to use a lambda, and instead be 1.6-compliant. Sorry about that, but it would keep the door open for a smarter launcher that complains when the version of Java is too old, rather than simply exploding.
if (Boolean.getBoolean("java.awt.headless")) return; | ||
final JWindow window = new JWindow(); | ||
splashWindow = window; // Save a non-AWT reference to the window. | ||
final File logoFile = new File(new File(System.getProperty("imagej.dir")), LOGO_PATH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be a bit smarter about the path here? If imagej.dir
is not set, would be nice to fall back to new File(".")
or some such.
splashWindow = null; | ||
} | ||
|
||
public static void main(final String[] args) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This main method was just for testing. Could you please remove it?
@@ -74,6 +74,9 @@ | |||
*/ | |||
public static void main(final String[] arguments) { | |||
originalArguments = arguments; | |||
if (Boolean.getBoolean("imagej.splash") || System.getProperty("imagej.splash") == null) { | |||
SplashScreen.show(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be paranoid, but we may want to wrap the SplashScreen.show()
with a try { ... } catch (Throwable t) { t.printStackTrace(); }
because we really don't want any bugs in the splash screen to prevent ImageJ from starting up.
Issues with the splash should never stop ImageJ from starting.
Thanks for your feedback @ctrueden!
I thought I had and then went back to do some more testing only to find out that there was an issue with the I have tested
If you are fine with the changes, I'll squash them into one commit (they don't seem educational) and merge to master. |
What about the |
|
@stelfrich Sorry for dropping the ball on this. Any reasons not to merge this? The worst-case scenario would be that people's ImageJs don't launch anymore... but I think there is little danger of that here, no? If the launcher "over-splashes" (i.e. splashes in scenarios where it shouldn't), we can simply push out additional fixes. Right? |
Correct. Let's get this merged! |
This removes the native implementation that was hard to maintain in the past and wasn't working properly in some cases. In addition, changes to how
libsplashscreen
is linked starting with Java 9 has made usinglibjvm
basically impossible.The new Java implementation offers a progress bar during startup which is currently static. Future versions could improve on this and make the startup even more verbose s.t. we can get more information on where it grinds to a halt / an issue appears.
Thanks for working on this @ctrueden!
This closes #50 and closes #40.