java-callgraph2 icon indicating copy to clipboard operation
java-callgraph2 copied to clipboard

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

Open Dean-Zhao opened this issue 2 years ago • 1 comments

在output_dir 中 执行 sh run.sh ,遇到以下错误 通过文件路径获取文件 _javacg_config/jar_dir.properties Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.adrninistrator.javacg.util.JavaCGFileUtil.readFile2List(JavaCGFileUtil.java:239) at com.adrninistrator.javacg.util.JavaCGFileUtil.readFile2List(JavaCGFileUtil.java:225) at com.adrninistrator.javacg.conf.JavaCGConfigureWrapper.getOtherConfigList(JavaCGConfigureWrapper.java:212) at com.adrninistrator.javacg.conf.JavaCGConfManager.getConfInfo(JavaCGConfManager.java:66) at com.adrninistrator.javacg.stat.JCallGraph.run(JCallGraph.java:87) at com.adrninistrator.javacg.stat.JCallGraph.main(JCallGraph.java:77) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 6 more 有解决办法吗?求助

Dean-Zhao avatar Apr 18 '23 08:04 Dean-Zhao

生成jar包时需要执行gradlew gen_run_jar命令来生成,这样会把依赖的组件拷贝到对应目录中,上面报错看起来是依赖组件不在对应的目录里

Adrninistrator avatar Apr 18 '23 08:04 Adrninistrator