Coder Social home page Coder Social logo

Comments (5)

wirew0rm avatar wirew0rm commented on August 11, 2024 25

I just looked up the required JVM arguments, in eclipse they have to be added to run configuration->VM arguments, other IDEs should have similar settings:
--add-modules=javafx.swing,javafx.graphics,javafx.fxml,javafx.media,javafx.web --add-reads javafx.graphics=ALL-UNNAMED --add-opens javafx.controls/com.sun.javafx.charts=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.iio=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.iio.common=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.css=ALL-UNNAMED --add-opens javafx.base/com.sun.javafx.runtime=ALL-UNNAMED

from chart-fx.

wirew0rm avatar wirew0rm commented on August 11, 2024

Hey, this is due to javafx using the jigsaw java module system and chart-fx not using it. There are multiple ways to resolve this:

  1. run with maven:
    bash mvn exec:java -Dproject.mainClass=de.gsi.chart.samples.<sample>
    This should allways work, but not very practical for use in IDEs (e.g. no incremental compilation). Maven does some magic to automatically set the right jvm parameters.
  2. use de.gsi.samples.utils.JavaFXLauncher (good for testing from inside IDEs, look into its javadoc for how it is supposed to work)
  3. add the appropriate --add-module and --opens jvm arguments. I'm currently not at my development machine, but i can look them up tomorrow morning.

This was one of the major hurdles in adding support for openjdk11/openjfx, obvously documentation for this should be improved.
The ultimate Problem is of course, that these parameters are even necessary. We also tried to implement jigsaw, but as some of our dependencies do not use jigsaw (they don't even provide a module name in the Manifest), this created a whole lot of other problems (also in combination with maven), so we decided to not use jigsaw for now.

from chart-fx.

wirew0rm avatar wirew0rm commented on August 11, 2024

I have added this information to the README.md, and will close this issue, feel free to reopen or create a new issue if you have more questions/problems.

from chart-fx.

Niekaiyuan avatar Niekaiyuan commented on August 11, 2024

Hi,I hava a question:I already added JVM arguments but when I running my code,it's show Module javafx.swing not found.And I have been used Maven to add the dependent of javafx-swing

from chart-fx.

wirew0rm avatar wirew0rm commented on August 11, 2024

Hey @Niekaiyuan,

since last year, we have been able to eliminate chart-fx's dependency on the javafx-swing module. So you should just remove the chartfx-swing entry from the add-modules list assuming your project doesn't otherwise use this module. I will update the README.md accordingly, thanks for bringing this up and please report back if this was indeed the problem.

from chart-fx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.