Same Classpath in Front-End and Rest of Habanero Java Compiler

Vincent from the Habanero research group actually asked me to make the change of setting the Polyglot classpath to be the same as the Soot classpath. That involved spending about a day figuring out how to even build Habanero Java, and then finding the best way to access the Soot classpath.

Initially I thought I could call [cci lang=”java”]Options.v().soot_classpath()[/cci], but that literally contains the value of the -cp argument passed in, which may be empty. In the end, I was able to access the exact Soot classpath without any code replication in one line in

[cc lang=”java”]options.classpath = soot.Scene.v().getSootClassPath();[/cc]

That was all that had to be done.

Now I hope the Habanero group agrees that it is the right thing to do to make sure that the front-end (Polyglot) and the rest of the compiler (Soot) use the same classpath and that they commit this change.

Now there are still issues with not being able to compile the same file more than once (“Duplicate values
/home/mgricken/bin/hj-1.1.0-mgricken/examples and /home/mgricken/bin/hj-1.1.0-mgricken/examples for option -sp”), and I also can’t yet run classes (“Error: Can’t find main class”) but I haven’t worked on that yet.


About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in DrJava. Bookmark the permalink.

Leave a Reply