<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi there ,<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I figured out the previous problem . as Bernhard said ,I should compile the .java files to .class files first while working with JDK8 . It is also indicated in a official tutorial(
<a href="https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool" id="LPNoLP484091">
https://github.com/Sable/soot/wiki/Introduction:-Soot-as-a-command-line-tool )</a><br>
<br>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
Now, if you're working with JDK8, these Java files need to be compiled before they can be passed on as command-line parameters</p>
</blockquote>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
but there's another problem when handling a class with package</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<b>Java code</b></p>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<span>package TriangleClass;<br>
</span>
<div><br>
</div>
<div>public class Triangle {<br>
</div>
<div> public String triangle(int a, int b, int c){<br>
</div>
<div><br>
</div>
<div> if(a > 0 && b > 0 && c >0){<br>
</div>
<div> if(a + b >c)<br>
</div>
<div> {<br>
</div>
<div> if(a == b || b ==c || a ==c)<br>
</div>
<div> {<br>
</div>
<div> if(a == b && b == c)<br>
</div>
<div> {<br>
</div>
<div> return "equilateral";<br>
</div>
<div> }<br>
</div>
<div> return "isosceles";<br>
</div>
<div> }<br>
</div>
<div> else{<br>
</div>
<div> return "scalene";<br>
</div>
<div> }<br>
</div>
<div> }<br>
</div>
<div> else{<br>
</div>
<div> return "Not Triangle";<br>
</div>
<div> }<br>
</div>
<div> }<br>
</div>
<div> else{<br>
</div>
<div> return "Not Triangle";<br>
</div>
<div> }<br>
</div>
<div> }<br>
</div>
<div><br>
</div>
<div> public int a;<br>
</div>
<div> public int b;<br>
</div>
<div> public int c;<br>
</div>
<span>}</span><br>
</div>
</blockquote>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
I compile it into a .class file ,then tried two different commands as follows:</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<div style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<span>D:\flowproject\soot\test><b>java -cp soot-trunk.jar soot.Main -cp .;rt.jar Triangle</b><br>
</span>
<div>Soot started on Wed Aug 22 21:37:47 CST 2018<br>
</div>
<div>java.lang.RuntimeException:<b> Class names not equal! TriangleClass.Triangle != Triangle</b><br>
</div>
<div> at soot.asm.SootClassBuilder.visit(SootClassBuilder.java:99)<br>
</div>
<div> at org.objectweb.asm.ClassReader.accept(ClassReader.java:637)<br>
</div>
<div> at org.objectweb.asm.ClassReader.accept(ClassReader.java:521)<br>
</div>
<div> at soot.asm.AsmClassSource.resolve(AsmClassSource.java:62)<br>
</div>
<div> at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:240)<br>
</div>
<div> at soot.SootResolver.bringToHierarchy(SootResolver.java:212)<br>
</div>
<div> at soot.SootResolver.bringToSignatures(SootResolver.java:273)<br>
</div>
<div> at soot.SootResolver.processResolveWorklist(SootResolver.java:174)<br>
</div>
<div> at soot.SootResolver.resolveClass(SootResolver.java:137)<br>
</div>
<div> at soot.Scene.loadClass(Scene.java:861)<br>
</div>
<div> at soot.Scene.loadClassAndSupport(Scene.java:847)<br>
</div>
<div> at soot.Scene.loadNecessaryClass(Scene.java:1577)<br>
</div>
<div> at soot.Scene.loadNecessaryClasses(Scene.java:1590)<br>
</div>
<div> at soot.Main.run(Main.java:248)<br>
</div>
<span> at soot.Main.main(Main.java:144)</span><br>
</div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<div style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<span>D:\flowproject\soot\test><b>java -cp soot-trunk.jar soot.Main -d ./xxx -cp .;rt.jar TriangleClass.Triangle</b><br>
</span>
<div>Soot started on Wed Aug 22 21:38:04 CST 2018<br>
</div>
<div>soot.SootResolver$SootClassNotFoundException:<b> couldn't find class: TriangleClass.Triangle
</b>(is your soot-class-path set properly?)<br>
</div>
<div> at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:232)<br>
</div>
<div> at soot.SootResolver.bringToHierarchy(SootResolver.java:212)<br>
</div>
<div> at soot.SootResolver.bringToSignatures(SootResolver.java:273)<br>
</div>
<div> at soot.SootResolver.processResolveWorklist(SootResolver.java:174)<br>
</div>
<div> at soot.SootResolver.resolveClass(SootResolver.java:137)<br>
</div>
<div> at soot.Scene.loadClass(Scene.java:861)<br>
</div>
<div> at soot.Scene.loadClassAndSupport(Scene.java:847)<br>
</div>
<div> at soot.Scene.loadNecessaryClass(Scene.java:1577)<br>
</div>
<div> at soot.Scene.loadNecessaryClasses(Scene.java:1590)<br>
</div>
<div> at soot.Main.run(Main.java:248)<br>
</div>
<div> at soot.Main.main(Main.java:144)<br>
</div>
<span></span><br>
</div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
when I handle a simple class without package , it can be done successfully.</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<b>Example </b><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<blockquote style="border-color: rgb(200, 200, 200); border-left: 3px solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<span> public class GetGreeting <br>
</span>
<div> { <br>
</div>
<div> public static void main(String [] args) <br>
</div>
<div> { <br>
</div>
<div> System.out.println("Hello world"); <br>
</div>
<div> <br>
</div>
<div> } <br>
</div>
<span> } </span><br>
</div>
</blockquote>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<div style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
I've searched anything about the error messages a long time online , still without a clue .</div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
please help , thank you!<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top: 0px; margin-bottom: 0px;">
<br>
</p>
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>发件人:</b> 周 筱川 <cobra@live.com><br>
<b>发送时间:</b> 2018年8月20日 6:25<br>
<b>收件人:</b> Bernhard Berger<br>
<b>抄送:</b> soot-list@CS.McGill.CA<br>
<b>主题:</b> 答复: [Soot-list] soot.CompilationDeathException: there were errors during parsing and/or type checking (JastAdd frontend)</font>
<div> </div>
</div>
<meta content="text/html; charset=gb2312">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thank you Bernhard , i'll try again and give a feedback later.<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>发件人:</b> Bernhard Berger <berber@tzi.de><br>
<b>发送时间:</b> 2018年8月20日 6:19<br>
<b>收件人:</b> 周 筱川<br>
<b>抄送:</b> soot-list@CS.McGill.CA<br>
<b>主题:</b> Re: [Soot-list] soot.CompilationDeathException: there were errors during parsing and/or type checking (JastAdd frontend)</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi,
<div class=""><br class="">
</div>
<div class="">please try to compile your source code using javac and analyze the bytecode instead of the source. As far as I know, the bytecode front end is better supported than the source front end.</div>
<div class=""><br class="">
</div>
<div class="">Regards, Bernhard<br class="">
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 20 Aug 2018, at 05:38, 周 筱川 <<a href="mailto:cobra@live.com" class="">cobra@live.com</a>> wrote:</div>
<br class="x_x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Hi there,</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
I'm a beginner for Soot, while trying to parse some java files , there's an error <span class=""></span>"soot.CompilationDeathException: there were errors during parsing and/or type checking (JastAdd frontend)".<span class="x_x_Apple-converted-space"> </span><br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
Thank you very much for any advice!<br class="">
<br class="">
<b class=""><span class="" style="font-size:14pt">Detail as follows:</span></b><br class="">
<br class="">
<b class="">Tried commands:</b><br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
java -cp D:\flowproject\soot\sootclasses-trunk-jar-with-dependencies.jar -debug soot.Main -cp . CardQueryService</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
java -cp D:\flowproject\soot\sootclasses-trunk-jar-with-dependencies.jar soot.Main --soot-classpath .;"%JAVA_HOME%"\jre\lib\rt.jar CardQueryService<br class="">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<b class="">Error Message<span class="x_x_Apple-converted-space"> </span></b><br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<span class="">Soot started on Mon Aug 20 11:20:20 CST 2018<br class="">
</span>
<div class="">soot.CompilationDeathException: there were errors during parsing and/or type checking (JastAdd frontend)<br class="">
</div>
<div class=""> at soot.JastAddInitialResolver.formAst(JastAddInitialResolver.java:66)<br class="">
</div>
<div class=""> at soot.JavaClassSource.resolve(JavaClassSource.java:57)<br class="">
</div>
<div class=""> at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:240)<br class="">
</div>
<div class=""> at soot.SootResolver.bringToHierarchy(SootResolver.java:212)<br class="">
</div>
<div class=""> at soot.SootResolver.bringToSignatures(SootResolver.java:273)<br class="">
</div>
<div class=""> at soot.SootResolver.processResolveWorklist(SootResolver.java:174)<br class="">
</div>
<div class=""> at soot.SootResolver.resolveClass(SootResolver.java:137)<br class="">
</div>
<div class=""> at soot.Scene.loadClass(Scene.java:861)<br class="">
</div>
<div class=""> at soot.Scene.loadClassAndSupport(Scene.java:847)<br class="">
</div>
<div class=""> at soot.Scene.loadNecessaryClass(Scene.java:1577)<br class="">
</div>
<div class=""> at soot.Scene.loadNecessaryClasses(Scene.java:1590)<br class="">
</div>
<div class=""> at soot.Main.run(Main.java:248)<br class="">
</div>
<span class=""> at soot.Main.main(Main.java:144)</span></div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<b class="">Java File Example:</b></div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
plz see the attachment<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt">
<br class="">
</div>
<span id="x_x_cid:B0E2354A-8145-46B6-8EAD-D7F2A9DA9E1E@fritz.box"><CardQueryService.java></span><span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Soot-list
mailing list</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:Soot-list@CS.McGill.CA" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">Soot-list@CS.McGill.CA</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://mailman.cs.mcgill.ca/mailman/listinfo/soot-list" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</body>
</html>