Skip to content

Instantly share code, notes, and snippets.

@Nithanim
Last active March 22, 2020 14:40
Show Gist options
  • Save Nithanim/642fa03df122a1c72f28b4b9ce360b45 to your computer and use it in GitHub Desktop.
Save Nithanim/642fa03df122a1c72f28b4b9ce360b45 to your computer and use it in GitHub Desktop.
IntelliJ, Maven, JavaFx and fucking hell of Jigsaw
So for anyone that has raged hard over this and cursed the people that made Jigsaw into oblivian becuase this fucking shit makes only problems.
Trying to launch Openjfx with java 11, 12 or whatever in IntelliJ with maven only gives
```
Caused by: java.lang.IllegalAccessError: class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @0x6804e207) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.util to unnamed module @0x6804e207
```
in your luckyest moment (Ignoring a lot of other shit error messages).
I may have found out what the hell it is doing. So IntelliJ launches an "Application" either with everything on the classpath or with module path support.
If your app has NO module-info.java then everything is put on classpath which makes unnamed modules and the module definition inside the dependencies are then completely wrong and dont work.
(e.g. javafx.fxml becomes unnamed module @0x6804e207)
Because it makes a fucking ton of sense that everything on the same classpath cannot access each other!
What you must do is create a module-info.java. There is no way around it except adding `--add-exports javafx.base/com.sun.javafx.logging=ALL-UNNAMED` of every module and every package to the jvm args.
But have fun with the module path that does not play nice with some of you dependencies!
Fucking shit with fucking jigsaw cost me so many days and weeks and brought me only problems and solved shit.
It is worse than the eternal fires of hell and there is nothing that wasted more of my time than this bullcrap.
And boy have I seen shit!
Addendum:
Lombok needs:
```
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.3.0.Final</version>
</dependency>
```
Spring needs:
`requires java.sql;`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment