Skip to content

Some 3.x Tools not working because JavaFX isn't on the classpath #110

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

Closed
processing-bot opened this issue Jul 4, 2020 · 10 comments
Closed

Comments

@processing-bot
Copy link
Collaborator

In GitLab by @Kllngii on Jul 5, 2020, 01:50

Description

As stated, Java 11 comes without JavaFX support, which needs to be provided separately. I found it out by trying some tools, for example, the "Perceptual Colorpicker", which didn't work.

Expected Behavior

The "Perceptual Colorpicker" should run without problems, like normal Processing scripts with JavaFX.

Current Behavior

A java.lang.NoClassDefFoundError exception is thrown, because the class javafx/scene/Parent is currently missing.

Steps to Reproduce

  1. Start the Processing IDE
  2. Try to open the "Perceptual Colorpicker" under Tools -> Perceptual Colorpicker

Your Environment

  • Processing version: 4.0a1
  • Operating System and OS version: macOS Mojave 10.14.6
  • Other information: I am using a MacBook Pro Late 2013.

Possible Causes / Solutions

JavaFX is no longer included in Java 11.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Hey there! So this is an interesting one... Curious what you think @benfry (and broader community!). So, we do ship JavaFX to support the FX2D mode but, right now, the IDE doesn't have any FX dependencies and it isn't on the classpath. We can add it to the various relevant classpaths and modify the library path for native libs (see #112). I'm leaning towards continuing down #112 b/c of the value of those tools to the community but I also see an argument that we don't want the IDE / tools to have an FX dependency.

@processing-bot
Copy link
Collaborator Author

Created by: neilcsmith-net

Not entirely sure what a "standard Java 11" is these days! 😄 JavaFX was never part of the JDK. However, there are multiple OpenJDK distributions that have bundled OpenJFX options, including Liberica and Zulu. Should that be the direction.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Hm, I don't like the idea of adding JavaFX as a dependency for the PDE since we're not using it and it's one more thing to support/sets an expectation for the future that it'll be available and works. We'd have to look at how many existing things actually depend on JavaFX.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

Sounds good! LMK how you want to proceed. We can put #112 on pause.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Ok, looks like this affects Art Station and Perceptual Color Picker.

G4P GUI Builder uses new PImage(java.awt.Image) so that's also broken, but unrelated to this (unless the next error will be it trying to load JavaFX).

Wonder if a Tool can include JFX jars in its path and have it work… The JFX download is from Gluon, who is also only providing 11.0.2 as a “public release” and requiring payment for the 11.0.8 “LTS” version, which doesn't feel like a direction we want to support for a dependency.

@processing-bot
Copy link
Collaborator Author

Created by: jeremydouglass

Wonder if a Tool can include JFX jars in its path

A problem that we have had in the past with libraries is that, if the libraries use the same dependency, two libraries cannot be installed at the same time. For example, Box2D, Fisica, and LiquidFun all use JBox2D, so they cannot be installed in Processing 3 at the same time.

https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577

cansik has been looking at a similar issue with OpenCV-based libraries

https://discourse.processing.org/t/dependency-management-for-libraries/18940

So a possible issue is, if we have multiple JavaFX tools / libraries and they need to bundle jars, it will cause the same all-mutually-exclusive problem: you can have Perceptual Colorpicker OR Art Station, but not both. One workaround would be to provide JFX 11.0.2 as a standalone processing library and have any affected tools document it as a requirement.

@cansik has an idea for lightweight dependency management (in forum thread above) as a future feature that could make declared dependencies downloadable by contributions manager, but even without that a library might solve the main problem for shared resources.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Hm, could you open a separate issue for that one? In that specific case, the error message was put in place because overwhelmingly, libraries were using conflicting versions of things like Box2D, which would break one another, and then I'd get angry reports that Processing was broken.

@processing-bot
Copy link
Collaborator Author

Created by: jeremydouglass

Sure, happy to -- should I open an issue for

  1. creating a JavaFX 11.0.2 standalone Processing library, or
  2. a dependency manager, or
  3. one new issue each

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Oh, I was thinking about the dependency issue; or if there's one already in the 3.x repo we can move it over here.

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Fixed for 3.0 alpha 5.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant