I'm trying to build soot.

I've downloaded the source code of JastAddExtensions using svn co https://svn.sable.mcgill.ca/abc/trunk/JastAddExtensions/, checked out the code of Soot using

  • git remote add soot https://github.com/Sable/soot.git
  • git pull soot develop.

Then I tried to build Soot using Ant and got following error message:

D:\dev\ro-01\soot\build.xml:102: The following error occurred while executing this line:
D:\dev\ro-01\JastAddExtensions\SootJastAddJ\build.xml:18: taskdef class JFlex.anttask.JFlexTask cannot be found
 using the classloader AntClassLoader[]

How can I fix this error? Where can I download a version of code of JastAddExtensions\SootJastAddJ, which is compatible with current version of Soot?

有帮助吗?

解决方案

You will get help faster on the Soot mailing list. You do not need do build the JastAdd part of Soot. It's pre-built in the directory "generated".

其他提示

Check out:

http://jflex.de/jflex_anttask.html

Simple answer: You probably haven’t copied the JFlex jar to ant’s library folder/directory.

If that doesn’t straighten you out… More complex solution: Find the soot Ant file, probably in the project root directory as build.xml.

Then find a task definition named “jflex” that probably looks like this:

<taskdef classname="jflex.anttask.JFlexTask" name="jflex" />

Change it to something like this:

<taskdef 
  name="jflex" 
  classname="jflex.anttask.JFlexTask"
  classpath="${compiler_tools_path}${jflex_jar_name}"
/>

Up near the beginning, with the other properties, create a new one with the location of a directory/folder you create and copy the latest JFlex jar to:

<property
name="compiler_tools_path"
    value="/Library/CompilerTools/"
/>

This is an appropriate place to create a directory/folder to store this on a Mac. Windows and Unix, anywhere externally installed jars are stored.

<property
name="jflex_jar_name"
value="jflex-1.5.1.jar"
/>

An example of a recent JFlex jar build. Check out:

http://jflex.de/

I hope this was helpful.

  • Jeff

I took a look at build.xml in the soot repository. The problem is with the target jastadd. The JustAdd compiler uses Beaver as its parser generator, which also requires JFlex as it's scanner generator for handling .flex files.

Just follow my simple solution mentioned previously. Make sure you rename the jflex-1.5.1.jar file that you copy to Ant's lib directory to "JFlex.jar" It's all in the document I gave you that first link to.

I'm answering this problem so late because I only just came across a similar problem with getting ant files to work with JFlex in Eclipse projects.

  • Jeff
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top