question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to build JavaFX project with JDK 17

See original GitHub issue

Demo Project: depressed-knocker.zip

module-info.java:

module com.example.depressedknocker {
    requires javafx.controls;
    requires javafx.fxml;

    opens com.example.depressedknocker to javafx.fxml;
    exports com.example.depressedknocker;
}

Project does not compile with JDK 17:

package javafx.application does not exist

/home/artamonov/.jdks/openjdk-17/bin/java -Dmaven.multiModuleProjectDirectory=/home/artamonov/test/depressed-knocker -Dmaven.home=/home/artamonov/projects/intellij/community/plugins/maven/maven36-server-impl/lib/maven3 -Dclassworlds.conf=/home/artamonov/projects/intellij/community/plugins/maven/maven36-server-impl/lib/maven3/bin/m2.conf -Dmaven.ext.class.path=/home/artamonov/projects/intellij/out/classes/production/intellij.maven.server.eventListener -Didea.launcher.port=40571 -Didea.launcher.bin.path=/home/artamonov/projects/intellij/bin -Dfile.encoding=UTF-8 -classpath /home/artamonov/projects/intellij/community/plugins/maven/maven36-server-impl/lib/maven3/boot/plexus-classworlds.license:/home/artamonov/projects/intellij/community/plugins/maven/maven36-server-impl/lib/maven3/boot/plexus-classworlds-2.6.0.jar:/home/artamonov/projects/intellij/out/classes/production/intellij.java.rt com.intellij.rt.execution.application.AppMainV2 org.codehaus.classworlds.Launcher -Didea.version=2021.3 package
[INFO] Scanning for projects...
[INFO] 
[INFO] -------------------< com.example:depressed-knocker >--------------------
[INFO] Building depressed-knocker 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ depressed-knocker ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ depressed-knocker ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /home/artamonov/test/depressed-knocker/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/artamonov/test/depressed-knocker/src/main/java/com/example/depressedknocker/HelloApplication.java:[3,26] package javafx.application does not exist

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
abhinayagarwalcommented, Sep 16, 2021

@jreznot You can now use 17.0.0.1 version.

1reaction
abhinayagarwalcommented, Sep 15, 2021

Hi @jreznot,

I found the following in debug log:

[DEBUG] Goal: org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)

The compile goal cannot be fixed with JavaFX 17 artifacts. Unlike Gradle, Maven doesn’t allow to override the behaviour of an existing goal. If you read the description my fix which went in 0.0.7, we have only fixed compilation when it is called in conjecture with javafx:run goal.

Unless someone has a better idea, I am afraid, maven-compiler-plugin:3.8.1:compile cannot be fixed until the next JavaFX release i.e. 17.0.1 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaFX: cannot build projects with JDK 17 and Maven
Create a new JavaFX project with Maven and JDK 17; Open module-info.java file. Warning is shown: image.png. Build failed with missing JavaFX packages:....
Read more >
Why can't IDEA find JavaFX package after upgrade JavaFX ...
Name the project and select Finish. Create a JavaFX HelloWorld.java class: Right-click on src, choose New | JavaFX Application.
Read more >
How to Use IntelliJ 2021.2.2 for JavaFX 17, JDK 17 ... - YouTube
In this tutorial, I will show you how to setup IntelliJ IDEA 2021.2.2 for JavaFX 17.0.0.1, JDK 17, JavaFX Scene Builder 16 on...
Read more >
Application run cannot find javafx.web module on Java 17 #117
The Gradle Application Plugin run task doesn't work when running with Java 17. Works fine on Java 11, but when updated to run...
Read more >
Unable to build project with Gradle 7.3.1 on Java 17
For whatever reason, the org.openjfx.javafxplugin plugin applies the org.javamodularity.moduleplugin . ... It was fixed in 1.8.8, so if you also ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found