简体   繁体   English

Maven 和 JavaFX:缺少 JavaFX 应用程序类

[英]Maven & JavaFX: Missing JavaFX application class

I try to build my JavaFX application with maven.我尝试使用 maven 构建我的 JavaFX 应用程序。 But currently the following error appears:但目前出现以下错误:

Missing JavaFX application class com.company.app.Main

The following codepart defines this:以下代码部分定义了这一点:

<manifestEntries>
    <JavaFX-Version>{javafx.version}+</JavaFX-Version>
    <Main-Class>com.company.app.Main</Main-Class>
    <implementation-version>2.0</implementation-version>
    <JavaFX-Application-Class>com.company.app.Main</JavaFX-Application-Class>
    <JavaFX-Class-Path>

    </JavaFX-Class-Path>
    <Class-Path>javafx-${javafx.version}.jar</Class-Path>
</manifestEntries>

The Main.java File contains the following code: Main.java 文件包含以下代码:

public class Main extends Application

So for me, everything looks fine... Does somebody know, why maven doens't find the class?所以对我来说,一切看起来都很好......有人知道,为什么 maven 没有找到这个类?

Thank you!谢谢!

I solved the problem.我解决了这个问题。 There was no sourcecode compiled, because I do not follow the standard directory layout: http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html没有编译源代码,因为我没有遵循标准的目录布局: http : //maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

您可以使用 IntelliJ IDEA 构建您自己的应用程序。它提供了正确的 maven 部署目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM