5

My project needs access to internal JDK classes, specifically internal JavaFX classes. This is no problem in Eclipse since I can add the Java 9 module I need to the Build Path. The problem occurs during the Maven build. I get errors like

class file for com.sun.javafx.binding.ExpressionHelperBase not found

When I tried to research a solution I ran into a terminology problem. Maven and Java both use the word "module" but they describe different things. I am referring to Java 9 Modules. Is it possible to add a dependency to such a module in the pom.xml like you would with a library?

Edit: The question has been marked as a possible duplicate. To clarify, I am not trying to change the Java version of the Maven project. The internal JDK classes I need are not accessible in the default configuration. They are part of an internal Java module that has to be specified in the Build Path to be accessible when developing in Eclipse. Now I need to know how I can tell Maven to include this module in order to successfully build my project which (again) relies on classes that are part of this module.

DeLoreanDriver
  • 205
  • 1
  • 10
  • Possible duplicate of [Change JDK in Maven Projects (Eclipse)](https://stackoverflow.com/questions/51616066/change-jdk-in-maven-projects-eclipse) – blurfus Oct 24 '18 at 05:33
  • Don't you need to put that into `module-info.java`? I would expect Maven to pick it up then –  Oct 24 '18 at 05:47
  • That solved the file not found error. Thanks! But it also lead to another error having to do with the visibility of the internal package. I found a workaround that works in my case. Basically I'm now avoiding using the internal API at all. – DeLoreanDriver Oct 24 '18 at 07:53

0 Answers0