正在运行JAR-错误:找不到或加载主类

时间:2019-10-28 15:48:01

标签: intellij-idea build jar exe artifact

我无法运行我的JAR文件。 我尝试了java -jar machines.jar,仍然收到相同的错误。 从Intellij内部尝试,再次出现相同的错误。请,我非常渴望解决方案。我只是放弃。 我有屏幕截图,可能是pom文件。 真的,我为此工作了几个月,现在我只想导出它。 如果我在使用Java时会遇到此类愚蠢的问题,那么我正在考虑转向c ++。 我准备放弃它,并在c ++上重新编写它。我就是那样。

路径: PATH = C:\ Program Files(x86)\ Common Files \ Oracle \ Java \ javapath; C:\ Program Files \ AdoptOpenJDK \ jdk-11.0.4.11-hotspot \ bin; C:\ Program Files \ AdoptOpenJDK \ jre-11.0。 4.11-hotspot \ bin; C:\ WINDOWS \ system32; C:\ WINDOWS; C:\ WINDOWS \ System32 \ Wbem; C:\ WINDOWS \ System32 \ WindowsPowerShell \ v1.0 \; C:\ WINDOWS \ System32 \ OpenSSH \ ; C:\ Program Files \ Intel \ WiFi \ bin \; C:\ Program Files \ Common Files \ Intel \ WirelessCommon \; C:\ Program Files(x86)\ Microsoft SQL Server \ 150 \ DTS \ Binn \; C: \ Program Files \ MySQL \ MySQL Shell 8.0 \ bin \; C:\ Program Files \ JetBrains \ IntelliJ IDEA 2019.2.3 \ bin;

尝试过launcjer4j。 大约有20次尝试在Intellij中进行构建。真的,我开始感到非常紧张和生气。我正在为这个项目工作几个月,这是我的第一个项目,我不能导出它!

这是我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0

<groupId>Codey</groupId>
<artifactId>Machines</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
    <finalName>Main</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
        <resource>
            <directory>src/main/java/FX</directory>
        </resource>
        <resource>
            <directory>src/main/java/FXMach</directory>
        </resource>
        <resource>
            <directory>src/main/java/FXGlob</directory>
        </resource>
        <resource>
            <directory>src/main/java</directory>
        </resource>
    </resources>
    <plugins>

    </plugins>
</build>

<dependencies>
    <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-assembly-plugin -->
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>

        <version>3.1.1</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-c3p0 -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>5.4.6.Final</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.jfoenix/jfoenix -->
    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>9.0.9</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.izpack</groupId>
        <artifactId>izpack-maven-plugin</artifactId>
        <version>5.1.3</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.17</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.4.4.Final</version>
    </dependency>


    <!--            JavaFX 12.0.2           -->
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-controls -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-graphics -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-base -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-fxml -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-web -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-web</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-media -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-media</artifactId>
        <version>12.0.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.openjfx/javafx-swing -->
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
        <version>12.0.2</version>
    </dependency>

</dependencies>

错误:找不到或加载主类Main enter image description here enter image description here enter image description here enter image description here enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

0 个答案:

没有答案