-
Notifications
You must be signed in to change notification settings - Fork 23
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
Switch to JavaFX native launcher #33
Comments
JavaFX may solve this issue |
However, we need to document what features we may be losing from migrating to JavaFX.. |
Note that whatever solution we settle on we also should ensure our Java3D problems are solved forever and ever. @ctrueden has a fork of Java 3D 1.6 that is Mavenized.. that may be sufficient.. |
JavaFX provides a developer-facing API for controlling which parameters go to the JVM (e.g., memory settings). Devs can write code letting users set these in their UI of choice, and propagate the information to the JavaFX launcher in a platform-agnostic way (uses Java Prefs API internally). See UserJvmOptionsService API docs for details. |
Experimental javafx branch can create standalone app (i.e., a double-clickable JAR file which leans on the installed system JRE) as well as a self-contained app (i.e., an app which bundles its own JRE). Unfortunately, there is no middle ground in JavaFX by default: you cannot have an app (EXE on Windows, .app bundle on OS X, etc.) which does not bundle a JRE. Or can you? Yes you can! This would be great so that users still get JRE security updates without it being ImageJ's responsibility. |
I updated the javafx branch in an attempt to use a custom preloader, but it doesn't work yet. To test things at a lower level—and also to test the |
I tested the This might not actually be the direction we want to go, but it is nice to know we can do it. Now, we just have to fully understand preloaders... |
Just my two cents: preloaders are not fully supported on native app launchers, but can be archived by other ways (I noted it down here) You could create that kind of "splash-screens" as first stage and just switching when ready (like proposed as solution 5 at stackoverflow) |
Hi, just wanted to inform you guys about a pull-request I made for supporting Hopefully you don't see this as spamming ;) |
@FibreFoX Thanks for the heads up, and for your great responsiveness in general. 😄 Will try to process and review the linked issue later this month. |
Reminder to myself: when progress is made on this issue, follow up on Fiji bug #933 with a link to a JavaFX-based Fiji application bundle, for Antonio Sechi to try out. |
When the bundle does not contain the stripped JRE (which is generated by the javafx-bundler itself), the generated There still is some problem which I found just right now with the javafx-maven-plugin: normal way for me was to specify an empty setting:
But the resulting .cfg-file still containes the wrong line. This is something, I will fix in the next days. EDIT: this is fixed in current 8.1.6-snapshot
For the debugger-thing, maybe you want to create multiple native launchers, this feature is available with normal ant-version of java(fx)bundler and will come in the next days (I'm already developing this feature). All CLI-arguments can be passed normally (and accessed in the main-method, there exists a IT-project for this), but to activate special java-properties I suggest to have multiple pre-configured launchers. Maybe it'll work to have UserJvmOptionsService for this instead of different native launchers, this is supported by putting the packager.jar as system-scoped dependency to your project, like in this IT-project (not nice, but working). All in all these ways might remove the need of own native launchers. |
Thanks @FibreFoX. All the links in particular are very helpful and much appreciated. We are increasingly leaning toward always bundling a JRE in the platform-specific distributions, for the reasons you mention. We want to ship the app via modern "blessed" distribution mechanisms such as the App Store on OS X, to make our users' lives easier. So at least on OS X we would need to bundle a JRE anyway. Regarding multiple native launchers: my current thinking is to have one native launcher with sensible defaults and configurability via the UserJvmOptionsService... and then one shell script launcher for developers which provides total customizability—e.g., launching with a debug port open. I cannot come up with a use case for non-developer users where specifying the desired JVM flags in a UI window, and then restarting, isn't good enough. |
This might be since java 1.8.0 update 60, see the issue on javafx-maven-plugin, this got a workaround in latest snapshot-version (had this problem on windows too)
This can be changed by modifying the generated installer-file (wsx), which is placed under some temporary folder, will be shown/reported, when javafx-maven-plugin contains <bundleArgument>
<installdirChooser>true</installdirChooser>
</bundleArgument> The default installation paths will be determined by the bundle argument |
For the splash-screen, because I don't want to have preloader-magic, I'm using some launcher-class which encapsulates some heavier calculationparts while showing slashscreen. I've created a GIST about this already which is free to use, but might not be the best solution. The reason I took that approach: Showing some messsages while loading user-settings or processing some signals which are business-logic, which does not fit into normal "splash-screen"-logic. |
😄 oh, and sorry for spamming your thread here |
Apparently there is now a Java Packager which is (will become?) part of Java 12. Here is an article discussing it: So the Java Packager will need to be evaluated as well, as part of this work. |
We are switching the Fiji launcher to a new one we made called Jaunch. It is much more flexible than the built-in Java |
Our goal is to simplify the ImageJ launch process so we are not so intimately tied to a custom, complex launcher with its own JDK version concerns.
Perfect world goals include:
JavaFX is currently our first choice for deployment. It appears to be capable of building standalone (no bundled JRE) and self-contained (bundled JRE) apps cross-platform. These is also a maven plugin
JavaFX issues that need to be solved:
<fx:platform basedir=""/>
to get standalone deployment. SOLVED by using build.xml. See also No way to set fx:platform basedir javafx-maven-plugin/javafx-maven-plugin#127.jfx:native
goal doesn't respect app name configuration. SOLVED - see jfx:native goal does not respect jfxMainAppJarName javafx-maven-plugin/javafx-maven-plugin#128.--debugger=8000
which the native launcher translated to JVM argument(s). See SO #30809330..jar
lock in Windows may be fixed in Java 7 allowing runtime swapping, in which case checking for updates at startup and replacing.jars
before loading classes and spinning up a context may be an option worth investigating, especially if we remove theImageJ
update site - which would become an immutable/lib
.java -splash
or JavaFX.Platform-specific notes
Linux
fakeroot
to be installed and just fails if it isn't. This will only affect developer machines though.Windows
exe
installer installed toC:\Users\username\AppData\Local\ImageJ
msi
installer installed toC:\Program Files\ImageJ
The text was updated successfully, but these errors were encountered: