Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Getting Started with JavaFX > Run HelloWorld using Maven" doesn't work with javafx 17 #210

Open
DieterMai opened this issue Nov 3, 2021 · 5 comments

Comments

@DieterMai
Copy link

When executing the steps described at https://openjfx.io/openjfx-docs/#maven the hello world program fails to compile. The issue only occurs with JavaFX 17 but not with 16 or earlier. see log file

maven.log

@DieterMai
Copy link
Author

my Environment:

$ mvn --version
Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: C:\Users\Dieter\devel\tools\maven\apache-maven-3.8.3
Java version: 17, vendor: Oracle Corporation, runtime: C:\Users\Dieter\devel\tools\jdk\OracleOpenJDK\jdk-17
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Dieter@Dieter-PC-2015 MINGW64 ~/devel/tutorials/jfxMavenRunExample/sample
$ java --version
openjdk 17 2021-09-14
OpenJDK Runtime Environment (build 17+35-2724)
OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

@yangbo
Copy link

yangbo commented Dec 4, 2021

When executing the steps described at https://openjfx.io/openjfx-docs/#maven the hello world program fails to compile. The issue only occurs with JavaFX 17 but not with 16 or earlier. see log file

maven.log

I have the same issue. By looking at the POM of javafx-controls version 17, I guess it's the POM issue, so I change the version to '17.0.2-ea+1', and it succeeded!

Conclusion, we can use the newest version of javafx 17 such as '17.0.2-ea+1' to run the sample.

@clartaq
Copy link

clartaq commented Dec 26, 2021

Changing the JavaFX version to 17.0.1 lets the program in the sample directory run, at least on my Mac.

  • The <artifactId> of HelloFX doesn't appear in any of the code for the sample application. It is sample on my system.
  • Changing the version of the plugin from 0.0.3 as produced by the archetype to any version 0.0.5 or later (including 0.0.8 as shown in the article) produces a warning, but the program will still run. Can't find any explanation for what the warning means or how to fix it.
  • You don't need to add the JavaFX dependencies as mentioned in the article. They are already present in the POM produced by the archetype.
  • The <mainClass> shown in the article is wrong. It is org.openjfx.App on my system.
  • There is no HelloFX.java file to run.
java --version
openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment Homebrew (build 17.0.1+1)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+1, mixed mode, sharing)
mvn --version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/local/Cellar/maven/3.8.4/libexec
Java version: 17.0.1, vendor: Homebrew, runtime: /usr/local/Cellar/openjdk/17.0.1_1/libexec/openjdk.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "12.1", arch: "x86_64", family: "Mac"

@authentictech
Copy link

authentictech commented May 31, 2023

Good find, thanks.

I found that any version of 17.0.x besides 17 works. I tested it with 17.0.1 and the latest 17.0.7.

If anyone can tell us why 17 has a problem I am curious to know and learn. Thanks.

@kevinrushforth
Copy link

See JDK-8273754. It affected JavaFX 17, and was fixed in 17.0.1 (and in a 17.0.0.1 patch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants