尝试使用 SOOT 时出现 NoClassDefFoundError 异常
我正在尝试使用 SOOT 生成调用图。但是,当我向它传递一些要分析的类时,会引发异常 NoClassDefFoundError 。我使用以下两个教程来执行一些命令: http://www.brics.dk/SootGuide/sootsurvivorsguide.pdf 和 http://www.bodden.de/2008/08/21/soot-command-line/#obtaining。
我已将要分析的java源代码放在SOOT的同一类路径中。所以当我要执行时,我使用了“。”指定当前目录。以下是我正在执行的命令:
java -cp jasminclasses-2.5.0.jar:sootclasses-2.5.0.jar:plyglot-1.3.5.jar:.soot.Main -cp . MainFrame
即使我省略 -cp 并立即调用 MainFrame,也会生成相同的错误。
有谁知道为什么会抛出这种异常?
I'm trying to use SOOT to generate call graphs. However when I pass it some class to be analyzed, the exception NoClassDefFoundError is being thrown. I'm using the following two tutorials to be able to execute some of the commands:
http://www.brics.dk/SootGuide/sootsurvivorsguide.pdf and http://www.bodden.de/2008/08/21/soot-command-line/#obtaining.
I have placed the java source code to be analyzed in the same classpath of the SOOT. So when i'm about to execute, i used the "." to specify the current directory. The following is the command I'm executing:
java -cp jasminclasses-2.5.0.jar:sootclasses-2.5.0.jar:plyglot-1.3.5.jar:.soot.Main -cp . MainFrame
The same error is being generated even if I leave the -cp out and just call the MainFrame immediately.
does anyone know why this kind of exception is being thrown?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
第一个类路径字符串看起来很奇怪,实际上您没有调用
soot.Main
类。尝试一下:编辑
关于您的最后一条评论,它看起来像一个典型的类路径错误。
如果您执行上述问题中的您的行,Java会尝试启动类
MainFrame
(默认包)中的main
方法 - 但不能找到那个班级。使用我的(正确的!)命令,java 尝试找到soot.Main
。再次仔细检查您的类路径:您必须提供正确的库路径。实际命令期望所有三个库加上 MainFrame.class 都位于当前目录中。
The first classpath string looks weird and your actually not calling the
soot.Main
class. Give this a try:Edit
Regarding your last comment, it looks like a typical classpath error.
If you execute your line from the question above, Java tries to start the
main
method in classMainFrame
(default package) - and can't find that class. With my (the correct!) command, java tries to findsoot.Main
.Double-check your classpath again: you have to provide correct paths to the libraries. The actual command expects, that all three libraries plus
MainFrame.class
are in the current directory.