You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to fix this with the Gradle setup? Starting the application with gradlew run works, but then I don't have a debugger support and it is not straightforward.
I think the problem is that the resource files are build to a different output directory (build/classes and build/resources), but IntelliJ does not merge the directories.
I've imported the project into IntelliJ on Windows 7, set JDK 12 as the Gradle and the Project SDK, but did not do any other changes.
The text was updated successfully, but these errors were encountered:
This is an issue with IntelliJ "default" configuration and how your project is configured as a "gradle" project.
Even if you don't set any VM arguments, IntelliJ will apply them for you. If you have a modular app, it puts everything in the module-path, and that's ok, but misses to add a required --patch-module: your resources and your Java classes are under the same package name but in different folders. That will leads to a "split-package" problem.
Therefore, the JavaFX gradle plugin adds this patch, and solves the issue, but this works only if you run a Gradle task (./gradlew run).
If you run from IntelliJ you will either have to:
run from the Gradle window, tasks -> application -> run.
or, merge source code and resources
or edit the run configuration, and add something like --patch-module hellofx=/path/to/resources
@jperedadnr Could you provide some more detailed instructions on how to get the sample applications to work in IntelliJ? You say "edit the run configuration" - which part of the configuration exactly? Also, what should I replace "hellofx" in your example with? What does this represent exactly? Also, what should I place in "/path/to/resources" as this is obviously not a real path. Again, what does this represent exactly? Finally, could you please point to any kind of documentation either specific to JavaFX or to Java in general where this might already be explained in more detail.
Hello,
The example for Intellij + modular + Gradle does not start when invoked directly from IntelliJ. It does not find the fxml file here:
and throws a NPE.
Is there a way to fix this with the Gradle setup? Starting the application with
gradlew run
works, but then I don't have a debugger support and it is not straightforward.I think the problem is that the resource files are build to a different output directory (
build/classes
andbuild/resources
), but IntelliJ does not merge the directories.I've imported the project into IntelliJ on Windows 7, set JDK 12 as the Gradle and the Project SDK, but did not do any other changes.
The text was updated successfully, but these errors were encountered: