no main manifest attribute, in demo-1.0.jar
今天想打包一个jar到Linux上运行,发现使用java -jar demo-1.0.jar 运行报错:
no main manifest attribute, in demo-1.0.jar
解决方案:
在maven的pom.xml中添加以下配置就可以
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>com.sf.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
no main manifest attribute, in demo-1.0.jar的更多相关文章
- 【Azure Developer】记录一次使用Java Azure Key Vault Secret示例代码生成的Jar包,单独运行出现 no main manifest attribute, in target/demo-1.0-SNAPSHOT.jar 错误消息
问题描述 创建一个Java Console程序,用于使用Azure Key Vault Secret.在VS Code中能正常Debug,但是通过mvn clean package打包为jar文件后, ...
- 【spring cloud】【IDEA】【Maven】spring cloud多模块打包,打包的jar包只有几k,jar包无法运行,运行报错:no main manifest attribute, in /ms-eureka.jar
======================================================================================== 引申:maven打包多 ...
- 【Maven篇】---解决Maven线上部署java.lang.ClassNotFoundException和no main manifest attribute解决方法
一.前述 maven 线上部署的话会出现一些问题比如java.lang.ClassNotFoundException或者no main manifest attribute的话,是因为maven 配置 ...
- no main manifest attribute, in testProject-1.0-SNAPSHOT.jar
no main manifest attribute, in testProject-1.0-SNAPSHOT.jar 错误描述: no main manifest attribute, in tes ...
- docker运行spring boot 包镜像出现no main manifest attribute问题
问题: 在进行docker部署的时候,开始对项目进行打包,在启动该镜像时 [root@topcheer docker]# docker run -it 00494e3d4550no main mani ...
- 启动servlet报错:The servlets named [DemoServlet] and [main.java.com.wlf.demo.servlet.DemoServlet] are both mapped to the url-pattern [/hello] which is not permitted
先看具体错误日志: [2019-04-26 09:29:25,484] Artifact demo-servlet:war: Artifact is being deployed, please wa ...
- 【iCore3 双核心板】DEMO 1.0 测试程序发布
iCore3 Demo V1.0 程序说明 一.概要 本资料包包含5个文件夹: 1.“arm”里是 icore3上 arm的程序包,开发环境为 KEIL 5.17: 2.“fpga”里是 icore3 ...
- 【iCore4 双核心板】DEMO V1.0 测试程序发布
iCore4 Demo V1.0程序说明 一.概要 本资料包含5个文件夹: 1.“arm”里是iCore4上arm的程序包,开发环境为KEIL5.17: 2.“fpga”里是iCore4上FPGA的程 ...
- 【iCore1S 双核心板】DEMO V1.0 测试程序发布
iCore1S Demo V1.0程序说明 一.概要 本资料包含5个文件夹: 1.“ARM”里是iCore1S上ARM的程序包,开发环境为KEIL5.17: 2.“FPGA”里是iCore1S上FPG ...
随机推荐
- 团队作业——项目Alpha版本发布
---恢复内容开始--- https://edu.cnblogs.com/campus/xnsy/SoftwareEngineeringClass1 https://edu.cnblogs.com ...
- 得到本地应用程序的EXE的路径
实现效果: 知识运用: Application类的ExecutablePath属性 //获取启动了应用程序的可执行文件的路径和可执行文件的名称 public static string Exec ...
- 安装mysql时出现问题的解决办法
问题一:在安装.重装时出现could not start the service mysql error:0 原因: 卸载mysql时并没有完全删除相关文件和服务,需要手动清除. 安装到最后一步exe ...
- javaweb基础(14)_jsp的原理
一.什么是JSP? JSP全称是Java Server Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术. JSP这门技术的最大的特点在于,写jsp就像在写h ...
- <!DOCTYPE>声明
定义和用法 <!DOCTYPE> 声明必须是 HTML 文档的第一行,位于 <html> 标签之前. <!DOCTYPE> 声明不是 HTML 标签:它是指示 we ...
- 使用lua做序列化和反序列化
-- lua对象序列化 function serialize(obj) local lua = "" local t = type(obj) if t == "numbe ...
- 【转】本人常用资源整理(ing...)
Deep Learning(深度学习): ufldl的2个教程(这个没得说,入门绝对的好教程,Ng的,逻辑清晰有练习):一 ufldl的2个教程(这个没得说,入门绝对的好教程,Ng的,逻辑清晰有练习) ...
- Yii2应用的运行过程
每一个框架都有一个入口脚本,Yii2也不例外.一般来说,对于Web应用的入口脚本是YiiBasePath/frontend/web目录下的index.php. 先观察这个文件: <?php de ...
- SSH框架面试总结----1
1:struts2的工作流程 1)客户端浏览器发出HTTP请求. 2)根据web.xml配置,HTTP请求会被FilterDispatcher接收. 3)根据struts.xml,找到对应的Actio ...
- MySQL查询时,查询结果如何按照where in数组排序
MySQL查询时,查询结果如何按照where in数组排序 在查询中,MySQL默认是order by id asc排序的,但有时候需要按照where in 的数组顺序排序,比如where in的id ...