excelExportSort.jar中没有主清单属性
时间: 2024-05-08 15:13:19 浏览: 114
出现excelExportSort.jar中没有主清单属性的错误,是因为打包时未指定主清单属性。可以通过以下两种方式解决该问题:
1.在Maven的pom.xml文件中添加以下mainClass代码,用于指定主启动类。
```xml
<build>
<plugins>
<!-- 指定主启动类 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.example.demo.DemoApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
```
2.在打包命令中指定主启动类,例如:
```shell
jar cfm excelExportSort.jar Manifest.txt com/example/demo/*.class
java -jar -Dloader.main=com.example.demo.DemoApplication excelExportSort.jar
```
其中Manifest.txt文件中指定了主启动类,这里的com.example.demo.DemoApplication为示例中的主启动类,实际中需要替换成你的主启动类。
阅读全文
相关推荐
















