[Soot-list] Exception during "Using Soot as a Program Optimizer" tutorial

Eric Bodden eric.bodden at mail.mcgill.ca
Wed Feb 28 20:33:19 EST 2007


Ok, I just found out the following:

The "Scanner" class, which you were missing first, is in the polyglot
jar file. The "jasmin.Main" class is obviously part of Jasmin. So the
following works for me:

soy ~/temp $ java -cp
sootclasses-2.2.3.jar:jasminclasses-2.2.3.jar:polyglotclasses-1.3.2.jar:.
soot.Main -O Hello
Soot started on Wed Feb 28 20:31:05 EST 2007
Transforming Hello...
Writing to sootOutput/Hello.class
Soot finished on Wed Feb 28 20:31:07 EST 2007
Soot has run for 0 min. 1 sec.

On 2/28/07, Eric Bodden <eric.bodden at mail.mcgill.ca> wrote:
> Ok, I just found out the following:
>
> The "Scanner" class, which you were missing first, is in the polyglot
> jar file. The "jasmin.Main" class is obviously part of Jasmin. So the
> following works for me:
>
> soy ~/temp $ java -cp
> sootclasses-2.2.3.jar:jasminclasses-2.2.3.jar:polyglotclasses-1.3.2.jar:.
> soot.Main -O Hello
> Soot started on Wed Feb 28 20:31:05 EST 2007
> Transforming Hello...
> Writing to sootOutput/Hello.class
> Soot finished on Wed Feb 28 20:31:07 EST 2007
> Soot has run for 0 min. 1 sec.
>
> Eric
>
> On 2/28/07, Ryan Rueth <rrueth at gmail.com> wrote:
> > I tried running Soot with the java -cp set as you said, but then I received
> > the following exception:
> >
> > sslab04 [~/Soot/Soot_Tutorials/intro] > java -cp
> > /homes/rrueth/Soot/sootclasses-2.2.3.jar:. soot.Main -O Hello
> >  Soot started on Wed Feb 28 20:07:03 EST 2007
> > Transforming Hello...
> > Writing to sootOutput/Hello.class
> > Exception in thread "main" java.lang.NoClassDefFoundError: jasmin/Main
> >         at soot.util.JasminOutputStream.flush
> > (JasminOutputStream.java:35)
> >         at
> > sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)
> >         at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)
> >         at java.io.OutputStreamWriter.flush
> > (OutputStreamWriter.java:213)
> >         at java.io.PrintWriter.flush(PrintWriter.java:270)
> >         at soot.PackManager.writeClass(PackManager.java:812)
> >         at soot.PackManager.writeOutput(PackManager.java:408)
> >          at soot.PackManager.writeOutput(PackManager.java:360)
> >         at soot.Main.run(Main.java:204)
> >         at soot.Main.main(Main.java:146)
> >
> > Which is why I originally added
> > /homes/rrueth/Soot/jasminclasses- 2.2.3.jar to my
> > classpath.  So, I tried to run Soot again with:
> >
> > java -cp
> > /homes/rrueth/Soot/sootclasses-2.2.3.jar:/homes/rrueth/Soot/jasminclasses-2.2.3.jar:.
> > soot.Main -O Hello
> >
> > But then I received the same java_cups/runtime/Scanner exception again.
> >
> > Thanks,
> > Ryan
> >
> >
> > On 2/28/07, Eric Bodden <eric.bodden at mail.mcgill.ca> wrote:
> > > This has to be a classpath issue. I assume your JVM gets confused
> > > because you have JAR files with a potentially overlapping but
> > > inconsistent set of classes on your classpath.
> > >
> > > Could you try with this command line?
> > >
> > > java -cp /homes/rrueth/Soot/sootclasses- 2.2.3.jar:. soot.Main -O Hello
> > >
> > > Eric
> > >
> > > On 2/28/07, Ryan Rueth <rrueth at gmail.com> wrote:
> > > > I'm currently trying to get acquainted with Soot; and thus, I'm starting
> > to
> > > > run through some of the posted tutorials.  Upon executing "java
> > soot.Main -O
> > > > Hello" at the beginning of the "Using Soot as a Program Optimizer"
> > tutorial,
> > > > I received the below exception.  I've also displayed my CLASSPATH
> > settings
> > > > at the bottom of the page as well.  Does anyone know what might be going
> > > > wrong here?
> > > >
> > > > Thanks,
> > > > Ryan
> > > >
> > > > sslab04 [~/Soot/Soot_Tutorials/intro] > java soot.Main -O Hello
> > > > Soot started on Wed Feb 28 19:35:20 EST 2007
> > > > Transforming Hello...
> > > > Writing to sootOutput/Hello.class
> > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > java_cup/runtime/Scanner
> > > >         at java.lang.ClassLoader.defineClass1(Native
> > > > Method)
> > > >         at
> > > > java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> > > >         at java.security.SecureClassLoader.defineClass
> > > > (SecureClassLoader.java:124)
> > > >         at
> > > >
> > java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> > > >         at
> > > >
> > java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> > > >         at java.net.URLClassLoader$1.run( URLClassLoader.java:195)
> > > >         at
> > > > java.security.AccessController.doPrivileged(Native
> > Method)
> > > >         at
> > > > java.net.URLClassLoader.findClass(URLClassLoader.java
> > :188)
> > > >         at java.lang.ClassLoader.loadClass(ClassLoader.java :306)
> > > >         at
> > > >
> > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
> > > >         at java.lang.ClassLoader.loadClass(ClassLoader.java :251)
> > > >         at
> > > >
> > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
> > > >         at jasmin.ClassFile.readJasmin(ClassFile.java:1045)
> > > >         at jasmin.Main.assemble(Main.java:24)
> > > >         at
> > > >
> > soot.util.JasminOutputStream.flush(JasminOutputStream.java:35)
> > > >         at sun.nio.cs.StreamEncoder$CharsetSE.implFlush
> > > > (StreamEncoder.java:410)
> > > >         at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java :152)
> > > >         at
> > > >
> > java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
> > > >         at java.io.PrintWriter.flush(PrintWriter.java :270)
> > > >         at soot.PackManager.writeClass(PackManager.java :812)
> > > >         at soot.PackManager.writeOutput(PackManager.java:408)
> > > >         at soot.PackManager.writeOutput(PackManager.java:360)
> > > >         at soot.Main.run (Main.java:204)
> > > >         at soot.Main.main (Main.java:146)
> > > > sslab04 [~/Soot/Soot_Tutorials/intro] >
> > > > sslab04 [~/Soot/Soot_Tutorials/intro] > echo $CLASSPATH
> > > > .:/homes/cs352/.classes:/homes/rrueth/Soot/sootclasses-
> > > >
> > 2.2.3.jar:/homes/rrueth/Soot/jasminclasses-2.2.3.jar:/homes/rrueth/polygotclasses-1.3.2.jar:./opt/sun-jdk-1.5.0.06/lib/rt.jar
> > > > sslab04 [~/Soot/Soot_Tutorials/intro] >
> > > > sslab04 [~/Soot/Soot_Tutorials/intro] >
> > > >
> > > >
> > > > _______________________________________________
> > > > Soot-list mailing list
> > > > Soot-list at sable.mcgill.ca
> > > > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
> > > >
> > > >
> > >
> > >
> > > --
> > > Eric Bodden
> > > Sable Research Group
> > > McGill University, Montréal, Canada
> > >
> >
> >
>
>
> --
> Eric Bodden
> Sable Research Group
> McGill University, Montréal, Canada
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list