检查n多遍也试了n多次,证明下面是MANIFEST.MF文件正确写法:

Manifest-Version: 1.0

Premain-Class: cn.yandz.monitor.SizeOfObjectUtils
Can-Redefine-Classes: true
Class-Path: lib/json-lib-2.4-jdk15.jar lib/ojdbc14.jar lib/commons-beanutils-1.8.3.jar lib/commons-collections-3.2.1.jar lib/commons-lang-2.6.jar lib/commons-logging-1.1.3.jar lib/ezmorph-1.0.6.jar

然而通过java -javaagent:jagent.jar执行时一直报错:java.lang.ClassNotFoundException: net.sf.json.JSONObject

花费不少时间终于查明:把Class-Path: lib/xx.jar含义理解错了,其真正要求Class-Path引用的这些jar需要放到当前执行jar的目录下的lib目录中,而不是把他们打包进jar中的lib目录下。

采用MANIFEST.MF之jar报错ClassNotFoundException解法的更多相关文章

  1. 单点登录(四)-----遇到问题-----cas server 源码部署tomcat运行报错ClassNotFoundException: org.jasig.cas.CasEnvironmentCo

    情况 cas单点登录 cas server 源码部署tomcat运行报错 把cas server的代码下载下来后使用gradle插件或者maven插件以及转化成eclipse·后导入发现部署到tomc ...

  2. springboot集成redis使用redis作为session报错ClassNotFoundException类RememberMeServices

    springboot 集成redis使用redis作为缓存,会报错的问题. 错误信息: java.lang.IllegalStateException: Error processing condit ...

  3. springboot集成redis报错-ClassNotFoundException: org.apache.commons.pool2.impl.GenericObjectPoolConfig

    当使用Springboot 2.0以上版本集成redis的时候遇到报错信息如下: Application run failed org.springframework.beans.factory.Un ...

  4. 启动SpringBoot的可执行jar 报错:target\spring-boot-hello-1.0-SNAPSHOT.jar中没有主清单属性

    打包成功,但是在执行时报错,没有主清单属性 解决: 增加红框内的依赖: <build> <plugins> <plugin> <groupId>org. ...

  5. Spring项目JUnit测试报错ClassNotFoundException解决

    Eclipse项目上有红色感叹号,各包显示正常.用JUnit测试部分能运行,部分报错,报错如下: Class not found UserTestjava.lang.ClassNotFoundExce ...

  6. Access restriction:The type JPEGCodec is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar 报错

    报错: Access restriction:The type JPEGCodec is not accessible due to restriction on required library C ...

  7. 包含MANIFEST.MF的jar可执行应用指定classpath及spring boot应用增量升级打包实现

    对于不包含MANIFEST.MF,或jar包中的MANIFEST.MF未指定MainClass的jar,可以通过java命令行选项-classpath指定classpath.但是如果是包含MainCl ...

  8. 【Flink】flink执行jar报错:java.io.IOException: Error opening the Input Split file 或者 java.io.FileNotFoundException

    报错内容 flink执行jar时,报如下错误: org.apache.flink.client.program.ProgramInvocationException: Job failed. (Job ...

  9. The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar报错

    缺少jstl依赖解析xml文件,报错jaspException 添加依赖如下: <dependency>              <groupId>jstl</grou ...

随机推荐

  1. 通过jxl 读取excel 文件中的日期,并计算时间间隔

    java读取excel里面的日期会出现相差8小时的问题. 比如excel里面有一个日期是:2012-7-2 17:14:03秒,用Cell cell=readSheet.getCell(colNo, ...

  2. SOSO街景地图 API (Javascript)开发教程(1)- 街景

    SOSO街景地图 Javascript API 干什么用的? 你想在网页里嵌入个地图,就需要它了! 另外,它还支持:地点搜索.周边/附近查询.地图标注.公交/驾车路线规划.地理坐标与地址相互转换.地理 ...

  3. Linux下面配置文件~/.bash_profile

    ~/.的意义是什么? ~ 代表你的/home/用户名目录 假设你的用户名是x,那么~/就是/home/x/ . 是代表此目录本身,但是一般可以不写 所以cd ~/. 和cd ~ 和cd ~/效果是一样 ...

  4. NodeJS 调试工具(node-inspector)

    node-inspector是基于Chrome的调试工具. 安装: npm install -g node-inspector 1.启动node-inspector来监听node.js的debug调试 ...

  5. mysql基础安全

  6. jQuery概述

    JQUERY   JS语法字典---网友总结 1.document.write(""); 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->ht ...

  7. 创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople 和AmericanPeople类重写父类的三个方法)。

    创建如下三个类:(People类中的三个方法分别输出一些信息,ChinaPeople 和AmericanPeople类重写父类的三个方法). ackage com.chuoji.text01; pub ...

  8. Network Wars-ZOJ2676最小割+01规划

    Time Limit: 5 Seconds Memory Limit: 32768 KB Special Judge Network of Byteland consists of n servers ...

  9. Golang 效率初(粗)测

    从接触 Golang 开始,断断续续已有差不多一年左右的时间了,都是业余自己学学看看,尚主要限于语法及语言特性,还没有用它写过实际的项目. 关于 Golang 的语法及语言特性,网上有很多资源可以学习 ...

  10. R画图中英文字体完美解决方案

    在某些时候,需要在R画图中添加中文,但是默认情况下,R对中文的支持不好. 当用R画PDF图,并且图中有中文的时候,安装并加载如下包library(showtext)然后:showtext.auto(e ...