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

javafx-archetype-simple fails to compile #15

Open
jtdevos opened this issue Sep 17, 2021 · 3 comments
Open

javafx-archetype-simple fails to compile #15

jtdevos opened this issue Sep 17, 2021 · 3 comments

Comments

@jtdevos
Copy link

jtdevos commented Sep 17, 2021

According to the "Getting Started with JavaFX" documentation, I can use maven to generate a simple JavaFX project with the following command:

mvn archetype:generate \
    -DarchetypeGroupId=org.openjfx \
    -DarchetypeArtifactId=javafx-archetype-simple \
    -DarchetypeVersion=0.0.3 \
    -DgroupId=org.openjfx \
    -DartifactId=sample \
    -Dversion=1.0.0 \
    -Djavafx-version=17

While this command does appear to generate some project files, the resulting project does not compile. Here is the output from the mvn compile command:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project sample: Compilation failure: Compilation failure:
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[3,26] package javafx.application does not exist
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[4,20] package javafx.scene does not exist
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[5,28] package javafx.scene.control does not exist
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[6,27] package javafx.scene.layout does not exist
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[7,20] package javafx.stage does not exist
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[13,26] cannot find symbol
[ERROR]   symbol: class Application
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[16,23] cannot find symbol
[ERROR]   symbol:   class Stage
[ERROR]   location: class org.openjfx.App
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[15,5] method does not override or implement a method from a supertype
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[20,25] cannot find symbol
[ERROR]   symbol:   class Label
[ERROR]   location: class org.openjfx.App
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[21,25] cannot find symbol
[ERROR]   symbol:   class Scene
[ERROR]   location: class org.openjfx.App
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[21,35] cannot find symbol
[ERROR]   symbol:   class StackPane
[ERROR]   location: class org.openjfx.App
[ERROR] /C:/Users/nobodyman/develop/scratch/sample/src/main/java/org/openjfx/App.java:[27,9] cannot find symbol
[ERROR]   symbol:   method launch()
[ERROR]   location: class org.openjfx.App
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Some environment details:
OS: Windows 10 Home 19043.1237
Maven: v3.8.2
JDK: Amazon Coretto jdk17.0.0_35

@eliocapelati
Copy link

Hello @nobodyman,

I got the same error, and during some investigation, I found that javafx-version=16 is working.

I definitely couldn't get it to work with javafx-version 17. (And there's no running example using it here: https://github.com/openjfx/samples)

I've tried with JDK from 11 to 17.

My env:
OS: Mac OS 10.15.7
Maven: Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
JDK: ["openjdk version "11.0.2" 2019-01-15", "openjdk version "17" 2021-09-14"]

@Oliver-Loeffler
Copy link

Interestingly it also works with JavaFX17 when module-info.java is deleted.

@TyPh00nCdr
Copy link

Upgrade org.openjfx:javafx-controls to version 17.0.1 in the pom.xml.

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

4 participants