java创建exe

  • pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>fdm</groupId>
  <artifactId>importdemo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
 
  <build>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>importdemo.Application</mainClass>
                        </manifest>
                    </archive>
                     <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                 <executions>
                        <execution>
                             <id>make-assembly</id>
                             <phase>package</phase>
                             <goals>
                                  <goal>single</goal>
                             </goals>
                        </execution>
                   </executions>
            </plugin>
    
        </plugins>
    </build>

</project>

  • 添加Application.java

package importdemo;
public class Application {
    public static void main(String[] args) {
        System.out.println("Hello");

    }

}

  • 使用maven在eclipse中打包成jar文件

java创建exe

  • 使用exe4j制作exe

java创建exe

java创建exe

java创建exe


java创建exe

java创建exe


java创建exe

java创建exe

一直下一步下一步

java创建exe