-
Notifications
You must be signed in to change notification settings - Fork 508
8281089: JavaFX built with VS2019 and jlinked into JDK 11.x fails to start #734
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
Conversation
👋 Welcome back kcr! A progress list of the required criteria for merging this PR into |
/reviewers 2 |
@kevinrushforth |
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.
I've created a sample that generates a jlinked runtime for JDK 11 and OpenJFX 19. I verified that it fails with 19-ea+3 and succeeds with this patch.
@kevinrushforth This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit e74cbe8.
Your commit was automatically rebased without conflicts. |
@kevinrushforth Pushed as commit e74cbe8. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The
javafx.graphics
module has a number of native libraries, including the redistributable Microsoft DLLs on Windows. When running an application using the standalone JavaFX SDK, we load all of the needed DLLs from the SDKbin
directory and everything works as expected.When creating the jmods, we currently exclude the Microsoft DLLs from
javafx.graphics.jmod
to avoid the problem described in JDK-8207015 wherejlink
complains about two modules (java.base
andjavafx.graphics
) deliver the same file(s). That works as long as the set of Microsoft DLLs delivered by the JDK is from the same or newer version of Microsoft Visual Studio. This means that you can't take, for example, JDK 11.0.x and run the latest version of JavaFX, since JDK 11.x uses VS 2017 and JavaFX 15 (and later) uses VS 2019.Up until now this has just been a minor bug, but we are now at the point where we need to update to VS 2019 for building JavaFX 11.0.15, which means that a jlinked JDK 11.0.X + JavaFX 11.0.15 will no longer work.
This fix is to add the Microsoft DLLs back into
javafx.graphics.jmod
(i.e., stop excluding them at build time), but deliver them inbin/javafx
so they don't conflict with the ones delivered by the JDK.The changes are:
build.gradle
- When creating the jmods on Windows, copy all of the DLLs to a javafx sub-directoryNativeLibLoader.java
- in the case of JavaFX modules jlinked into the Java runtime, load the libraries first from${java.home}
rather than always falling back toSystem::loadLibrary
. Most of the changes are just simple refactoring. The additional logic is in the newlibDirForJRT
method.When running using the SDK or the modules on maven central, there is no change in behavior.
I've tested this on all platforms, including a test of a custom JDK 11.x created with jlink. On a Windows I tested it on a system where a key VS 2019 runtime library was not present in C:\Windows\System32 and it now runs.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/734/head:pull/734
$ git checkout pull/734
Update a local copy of the PR:
$ git checkout pull/734
$ git pull https://git.openjdk.java.net/jfx pull/734/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 734
View PR using the GUI difftool:
$ git pr show -t 734
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/734.diff