Closed SomeoneSometimes closed 7 years ago
Unfortunately, Soot's java frontend is heavily outdated. I strongly discourage from using it.
You should be able to solve the problem by compiling your sources to bytecode first and then run Soot on the .class files with -src-prec class
.
Thanks! According your advice, i translate my .java file to .class file fistly, and it run successful!
But i hava another question, when my .java file has package createThread
, the run always go wrong.
So if i just want to translate one .java file in a project, what additional configurations should i add?Thanks!
It is important that you specify the root of the package structure as your process path.
For instance, if you have java class a.b.MyClass
and you specify the bin folder as output directory for javac, the folder structure will look like this: bin/a/b/MyClass.class
. In this case, you should specify the process path of soot like this: "soot -process-dir bin/".
This should solve the error.
Interesting! As your description, I added a layer of folders, now my folder structure looks like this:..../hhh/createThread/hello.class
,and my Options is Options.v().set_process_dir(Arrays.asList("G:/FlowDroid/hhh"));
,it run successful! Thank you very much!
I try this code
The test.java code is analyzed as follows
The following exception occurs during the run
Who can help me? Thanks!
Update: Now I change the Option of "process_dir" to Options.v().set_process_dir(Arrays.asList("G:/FlowDroid/test/"));.There is only one java file HelloWorld.java in the test folder),and occurs this error
The version of java used is 1.8,When I use the soot command line, the 1.8 version of the java error, then I replaced the 1.6 version can be successfully run.Strangely, my flowdroid in the 1.8 version of the Java can run, the above error is java version of the problem? There is also a question is that when my java inside package xxxx;, try to convert this java file will always produce errors,why?