Skip to content
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

8256362: JavaFX must warn when the javafx.* modules are loaded from the classpath #354

Closed

Conversation

kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Nov 17, 2020

This fix adds documentation and a warning to clarify that loading the JavaFX modules from the classpath is not a supported configuration. This will not affect deployments that put the JavaFX modular jars on the classpath, but will simply warn that it is an unsupported mode.

JavaFX is built and distributed as a set of named modules, each in its own modular jar file. This supports running both modular and non-modular applications.

The JavaFX runtime expects its classes to be loaded from a set of named javafx.* modules, and does not support loading those modules from the classpath. The Java launcher will fail to load applications that extend javafx.application.Application unless the javafx.graphics module is on the module path.

Applications that do not extend javafx.application.Application can be loaded even if the javafx.* classes are loaded from the classpath, but this is an unsupported configuration.

This creates the perception that there is a problem with the standard case of loading a subclass of javafx.application.Application, since it fails to load in the case where the JavaFX classes are loaded from the classpath. Further, allowing applications to run in an unsupported mode that likely has bugs creates a maintenance burden. Another problem is that when the JavaFX classes are loaded from the classpath, it breaks encapsulation, since we mo longer get the benefit of the java module system.

The primary reason given for application deployments loading the javafx modules on the classpath usually boils down to one of tooling support, although both gradle and maven now support modules as do all of the popular IDEs.

/csr needed
/reviewers 2


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8256362: JavaFX must warn when the javafx.* modules are loaded from the classpath

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jfx pull/354/head:pull/354
$ git checkout pull/354

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 2020

👋 Welcome back kcr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added rfr Ready for review csr Need approved CSR to integrate pull request labels Nov 17, 2020
@openjdk
Copy link

openjdk bot commented Nov 17, 2020

@kevinrushforth this pull request will not be integrated until the CSR request JDK-8256422 for issue JDK-8256362 has been approved.

@openjdk
Copy link

openjdk bot commented Nov 17, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@mlbridge
Copy link

mlbridge bot commented Nov 17, 2020

Webrevs

@openjdk openjdk bot removed the csr Need approved CSR to integrate pull request label Dec 11, 2020
Copy link
Member

@arapte arapte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kevinrushforth
Copy link
Member Author

I am switching the target branch to jfx16 now that we are in RDP1 and have forked the stabilization branch.

@kevinrushforth kevinrushforth changed the base branch from master to jfx16 January 7, 2021 16:26
@openjdk
Copy link

openjdk bot commented Jan 9, 2021

@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:

8256362: JavaFX must warn when the javafx.* modules are loaded from the classpath

Reviewed-by: arapte, pbansal, jvos

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 24 new commits pushed to the jfx16 branch:

  • 9dd2058: 8259639: GitHub actions: build fails on Linux due to missing apt-get update
  • 9c84c77: 8211294: ScrollPane content is blurry with 125% scaling
  • c197b62: 8242621: TabPane: Memory leak when switching skin
  • e74f679: 8254101: Update copyright header for files modified in 2020
  • 53fe38b: 8258592: Control labels in Dialogs are truncated at certain DPI scaling levels
  • e61b923: 8242361: JavaFX Web View crashes with Segmentation Fault, when HTML contains Data-URIs
  • fb8e0cd: 8253356: JavaFX Terminology Refresh
  • f2928d9: 8256983: GitHub actions: specify the version of each platform OS and compiler
  • ebb59e9: 8201568: zForce touchscreen input device fails when closed and immediately reopened
  • 97d655f: 8256012: Fix build of Monocle for Linux
  • ... and 14 more: https://git.openjdk.java.net/jfx/compare/dd22cd2d97d4bfc305e44f2e77b4c104c62ff31f...jfx16

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the jfx16 branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Jan 9, 2021
Copy link
Collaborator

@johanvos johanvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, and I didn't hear objections (on the warning) on this PR nor in JBS or the mailinglist, so this is ok to be merged.

@kevinrushforth
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Jan 12, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Jan 12, 2021
@openjdk
Copy link

openjdk bot commented Jan 12, 2021

@kevinrushforth Since your change was applied there have been 24 commits pushed to the jfx16 branch:

  • 9dd2058: 8259639: GitHub actions: build fails on Linux due to missing apt-get update
  • 9c84c77: 8211294: ScrollPane content is blurry with 125% scaling
  • c197b62: 8242621: TabPane: Memory leak when switching skin
  • e74f679: 8254101: Update copyright header for files modified in 2020
  • 53fe38b: 8258592: Control labels in Dialogs are truncated at certain DPI scaling levels
  • e61b923: 8242361: JavaFX Web View crashes with Segmentation Fault, when HTML contains Data-URIs
  • fb8e0cd: 8253356: JavaFX Terminology Refresh
  • f2928d9: 8256983: GitHub actions: specify the version of each platform OS and compiler
  • ebb59e9: 8201568: zForce touchscreen input device fails when closed and immediately reopened
  • 97d655f: 8256012: Fix build of Monocle for Linux
  • ... and 14 more: https://git.openjdk.java.net/jfx/compare/dd22cd2d97d4bfc305e44f2e77b4c104c62ff31f...jfx16

Your commit was automatically rebased without conflicts.

Pushed as commit 1d45997.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@kevinrushforth kevinrushforth deleted the 8256362-warn-classpath branch January 12, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
4 participants