-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Linux: load openjfx when exist #93
Conversation
When java is 11 and openjfx is specified by OPENJFX_CLASSPATH automatically load openjfx as module. This help plugin which use javafx.swing GUI component working. Signed-off-by: Hiroshi Miura <[email protected]>
OmegaT-Browser is an one that use OpenJFX. |
This modification is necessary because OpenJFX's Swing implementation access internal class of Swing. It should be loaded as module when launching java, otherwise when omegat-browser plugin load, java report class-not-found. |
I'm kind of confused about This is not a standard envar, is it? The user must manually set this? If the user has to manually set something anyway, why not just have the user pass the correct arguments to the launch script? Like ./OmegaT --module-path /path/to/whatever --add-modules=javafx.base,javafx.controls,javafx.swing,javafx.web If that doesn't work because those args need to come earlier in the invocation, then we could add a JAVA_OPTS="--module-path /path/to/whatever --add-modules=javafx.base,javafx.controls,javafx.swing,javafx.web" ./OmegaT |
User need to set an environment variable Previous stable versions of Linux distribution (Debian/Ubuntu 18.04, Fedora, OpenSUSE) released with OpenJDK 8 and OpenJFX11, , and because Java8 is not modular, OpenJFX is installed in JRE lib directory. So user don't need to know a hack discussed here. Since recent distro such as Ubuntu 20.04 has OpenJDK 11, which is modular, then OpenJFX is placed separate directory. Allowing loading OpenJFX is enough for OmegaT itself, and it is easy that plugin author help their users to install openjfx and set environment variable . There may be another story for Windows and macOS users, but I don't know the way to solve. |
Thanks for the additional information. My main concerns are:
How is the user expected to determine the correct value of Also, can you see if the changes I pushed work for you? I did some cleanup but I can't really test whether I broke anything. |
At first I see an issue at OmegaT-Browser plugin, I've pushed a build configuration to bundle OpenJFX with OmegaT-Browser plugin. It works for build but not works for user. It is because the plugin use openjfx-swing that is not work just by bundle openjfx native library with plugin. It is a story why I propose here a minimal addition.
Yes, you are right. The issue is one in a specific plugin. @yoursdearboy Can you guide your users to run the plugin with necessary argument for omegat, or guide your users to use specific Java runtime that support OpenJFX natively? I'd like to close here without merge, but the discussion would help @yoursdeearboy and other java developers. |
You don't have to close yet. If this really is the most reasonable solution then I'm ok with it; I just haven't yet understood why other solutions are worse. |
I am trying to learn more about the omegat-browser plugin so I can better understand the tradeoffs.
Thoughts:
|
How to provide OpenJFX as a plugin
We can learn a partial solution from JOSM project; Java OpenStreetMap editor. It resolves the issue with
It realizes the "nice" solution. refs
It may not be a perfect but worth. Another big issueOne of big barriers is a Swing-OpenJfx binding. https://stackoverflow.com/a/55876672
|
There is only a browser plugin which use OpenJFX, I'd like to close here and the issue should be resolved in browser plugin. |
…brack; Signed-off-by: Hiroshi Miura <[email protected]>
When java is 11 and openjfx is specified by OPENJFX_CLASSPATH
automatically load openjfx as module.
This help plugin which use javafx.swing GUI component working.
Current distribution with JRE bundles AdoptOpenJDK 8 that does not support JavaFX.
When user downloads OmegaT distribution without JRE, and use java environment on Linux,
there may be a OpenJDK 11 and it can be with OpenJFX.
This modification support the situation.
Signed-off-by: Hiroshi Miura [email protected]