Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IntelliJ IDEA中的Java11和JavaFX_Java_Maven_Intellij Idea_Javafx_Fxml - Fatal编程技术网

IntelliJ IDEA中的Java11和JavaFX

IntelliJ IDEA中的Java11和JavaFX,java,maven,intellij-idea,javafx,fxml,Java,Maven,Intellij Idea,Javafx,Fxml,我在IntelliJ IDEA 2018中创建了JavaFX项目。我已经安装了Java JDK 11,我的项目(Maven)包括所有需要的依赖项: <dependencies> <dependency> <groupId>org.openjfx</groupId> <artifactId>javafx-controls</artifactId> <version&

我在IntelliJ IDEA 2018中创建了JavaFX项目。我已经安装了Java JDK 11,我的项目(Maven)包括所有需要的依赖项:

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>11</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>11</version>
    </dependency>
</dependencies>

问题在哪里?第54版和第52版是什么?新Java 11支持JavaFX吗?

尝试将其添加到pom.xml文件中

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>11.0.1</source>
                <target>11.0.1</target>
            </configuration>
        </plugin>
    </plugins>
</build>

org.apache.maven.plugins

,这就是我得到配置的地方。

只要尝试使用JAVA 10,您只需使用该版本创建新文件夹,并且不需要包含任何库。之后试着运行它。如果你想下载,这里有一个链接


确保项目设置也指向JDK11@Jos佩雷达,我查过了。他们指出,看起来您试图用Java8(类文件版本52)执行您的程序,而您的JavaFX是为Java10(类文件版本54)编译的,因为Java8不知道这个版本,所以无法运行。我可以将其设置为Java11的每个地方都使用最新版本的maven和所有插件吗?您是否使用Java11执行maven?
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>11.0.1</source>
                <target>11.0.1</target>
            </configuration>
        </plugin>
    </plugins>
</build>