"taskdef class JFlex.anttask.JFlexTask cannot be found" when building Soot - java

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

Related

Stanford OpenIE example code compile error

http://nlp.stanford.edu/software/openie.shtml generates compile time error :
SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation cannot be resolved to a type
I am running java-8 under eclipse 2016. corenlp-full-2015-12-01.zip, openie.jar, openie-models.jar are in included in my eclipse project.
Error generated by line of:
System.out.println(sentence.get(SemanticGraphCoreAnnotations.EnhancedDependenciesAnnotation.class).toString(SemanticGraph.OutputFormat.LIST));
thanks
If I were to guess, this sounds like a classpath issue. What happens if you remove either openie.jar or the corenlp distribution? In theory, openie.jar should contain everything you need to run the Open IE system.
I have the same error.
What does this package edu.stanford.nlp.naturalli; in the first line of the code snippet mean?
I do not have much Java knowledge, I just created a Java project somewhere and included the same files as WH Sweet did.
I just found that within the corenlp project subfolder naturalli there is a OpenIEDemo.java already. Maybe the explanation for this would solve the initial problem..

Using org.eclipse.core.expressions: expressionLanguage.exsd could not be found

I am following this guide to incorporate an activation expression (from core expressions) into my own extension point. As the guide says, I have created my extension point schema as follows:
But as you can see, I get errors for the referenced elements. (Element 'xxx' is not defined).
Actually, when I switch to the definition tab and double-click in the schema URL in the Schema inclusions list, I get the error message schema:/org.eclipse.core.expressions/schema/expressionLanguage.exsd could not be found.
My first suspicion was that something might have changed here for Eclispe Kepler, but the docs say anything about it. And I imported the org.eclipse.core.expressions plug-in from the Plug-Ins view into my workspace temporarily and checked if the referenced schema is actually where it is supposed to be (which it is). So this seems to be ok.
My next suspicion was that this had something to do with my target platform, so I double-checked my target platform, but I don't see any issue here. It includes (among others) the features
org.eclipse.platform 4.3.2.v20140221-1852
org.eclipse.platform.source 4.3.2.v20140221-1852
org.eclipse.rcp 4.3.2.v20140221-1700
org.eclipse.rcp.source 4.3.2.v20140221-1700
and the Core Expressions bundles are there as well:
org.eclipse.core.expressions 3.4.501.v20131118-1915
org.eclipse.core.expressions.source 3.4.501.v20131118-1915
I am currently stuck. Any pointer what else I can check or how I can fix this is appreciated.
Does your plug-in file (org.eclipse.core.expression.xxx.jar) actually have the schema file?
Today I had same problem and found that the jar file doesn't have the schema file.
I downloaded source jar file which have the schema file (Actually I found the source jar file from : http://grepcode.com/snapshot/repository.grepcode.com/java/eclipse.org/4.2/org.eclipse.core/expressions/3.4.400) and put the schema file into my jar file and it solves the problem.
Good luck.
Ok, several chaotic attempts of
reloading the target platform
cleaning all projects
restarting Eclipse with -clean switch
seems to have done the trick. I am not sure what caused this, but now the error has vanished (and I hope it stays this way).

Overtone Livecoding with Emacs/Slime/Swank/cake - Could not locate overtone.live__init.class

I am trying to use emacs and slime to connect to swank to live code using Overtone. I have the whole thing pretty much working, but when i try to run
(ns foo
(:use [overtone.live]
[overtone.inst.synth]))
(definst bar [] (saw 220))
I get the error 'Could not locate overtone/live__inti.class or overtone/live.clj on classpath:' Which i gather basically means that the class files are not where it is looking for them. I am not sure what to do to fix this.
Important note: Slime/Swank/Cake are deprecated means of connecting Overtone and Emacs. Instead, consider using nREPL via Leiningen 2+ and CIDER
it looks like you haven't got the Overtone jar on the classpath. Things to check:
You have overtone-X-Y-X.jar in your project's lib directory
Your project isn't called Overtone (that can cause issues with tools like lein)
Finally, you might want to take a look at this setup video: http://vimeo.com/25190186 which describes the process of getting an Overtone dev environment setup.
Good luck and come join the mailing list and share your thoughts: http://groups.google.com/group/overtone
Have you tried confirming that overtone is in your java classpath?
(System/getProperty "java.class.path")
It's most likely a temporary fix, as I'm just getting my feet wet with clojure and overtone, but I included overtone as a global dependecy in my ~/.cake directory and installed it with:
cake deps --global
Additionally, I'd reccomend updating to the latest version of overtone as it looks like the vimeo link is a few versions behind what is currently reflected on clojars:
http://clojars.org/overtone

taskdef A class needed by class org.apache.jasper.JspC cannot be found: Could not initialize class org.apache.jasper.JspC

Hi I am getting the error taskdef A class needed by class org.apache.jasper.JspC cannot be found: Could not initialize class org.apache.jasper.JspC when I tried to build the build.xml file. can anyone please give me a solution. Thanks in advance
I added the following to my ant classpath:
/usr/local/apache-tomcat-7/bin/tomcat-juli.jar
I had this problem too, but it was a long time ago and unfortunately my memory has become quite foggy on the subject.
As I recall, you need to start ANT with the -lib command line switch and have it point to some jar files that are needed by Jasper's JSP compiler. Again, I don't remember exactly which ones, but I think the JDK's tools.jar was one of them, as well as all the jars with jasper in the names, and commons-logging.jar and commons-el.jar. You'll have to do some experimenting :).
Do you have the required Jasper libraries in your classpath?
That is a relatively high level exception. If you would like to know more detail about what is missing from your classpath, you can run ant with the -verbose flag on the commandline.
It would be good to see the build.xml that you are using. Apache has put an example out here, which sounds similar to what you are using. If so, it requires that you specify some vars.
For this example Apache suggests:
The following command line can be used to run the script (replacing the tokens with the Tomcat base path and the path to the webapp which should be precompiled):
$ANT_HOME/bin/ant -Dtomcat.home=<$TOMCAT_HOME> -Dwebapp.path=<$WEBAPP_PATH>
If you are getting this error in eclipse "taskdef A class needed by class org.apache.jasper.JspC cannot be found: Could not initialize class org.apache.jasper.JspC",
jasper-compiler.jar consists of "org.apache.jasper.JspC", so please copy the commons-collections.jar in the same dirctory.
jasper-compiler.jar will be in C:\jboss-4.0.2\server\default\deploy\jbossweb-tomcat55.sar.
Hope it will resolve the issue.

Groovy, Netbeans and Java EE

I want to develop a web application (no frameworks) mixing java with groovy. I am using the IDE Netbeans with the plugin.
If I start a new Java SE project and add a groovy class, it works with no problems.. but when I create a new java EE project and add a groovy class it can't compile and shows me the following error:
/home/webcodei/NetBeansProjects/testeGroovyWeb/src/java/pacote/Hello.java:23: cannot find symbol
symbol : class Hroovy
location: class pacote.Hello
Hroovy h = new Hroovy();
/home/webcodei/NetBeansProjects/testeGroovyWeb/src/java/pacote/Hello.java:23: cannot find symbol
symbol : class Hroovy
location: class pacote.Hello
Hroovy h = new Hroovy();
2 errors
/home/webcodei/NetBeansProjects/testeGroovyWeb/nbproject/build-impl.xml:383: The following error occurred while executing this line:
/home/webcodei/NetBeansProjects/testeGroovyWeb/nbproject/build-impl.xml:211: Compile failed; see the compiler error output for details.
FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
Does anybody have a clue of how do I enable Java EE + Groovy in netbeans?
ps: I know the existence of Grails
ps2: The Groovy jar is in my classpath.
Thank you for all!
It appears that the NetBeans 6.5 Java Webapp project manager does not have the "Enable Groovy" support that is present in the Java App and Java Class library projects.
I can think of two ways you might get around this:
First, you could put your Groovy code and tests in a separate project as a Java Class Library. Then make the Java webapp dependent on the Groovy project. NetBeans will build the dependent project automatically so you'll hardly notice they are in separate projects.
Second, the "Enable Groovy" isn't magic. All it does is write a groovy-build.xml in /nbprojects and modify build-impl.xml to import it. The groovy-build.xml overrides the default "javac" macro to invoke "groovyc" instead. If you're at all handy with Ant, you could copy a groovy-build.xml from a Java Application project and copy it to your Java Web project and then import it from your build.xml (before build-impl.xml is imported). The groovy-build.xml would likely need a few tweaks as some of the properties between a webapp and class library are a little different.
#Dave Smith,
This was exactly what I did. I created one javase project and one webapp and started to compare them. After a few minutes I realised that the only diference was the groovy-build.xml.
So I copied the groovy-build.xml into the dir, and inserted the following lines into my build.xml:
<import file="nbproject/groovy-build.xml"/>
Right before the regular
<import file="nbproject/build-impl.xml"/>
And then called the groovy file to overwrite the -init-macrodef-javac.
<target depends="-groovy-init-macrodef-javac" name="-pre-compile">
</target>
I also needed to change the namespace from the groovy-build.xml to mine ex:
<macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
And inserted the j2ee classpath (${j2ee.platform.classpath}) to the attribute a few lines later:
<attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
After that the project worked successfully! =D
Thank you for all!

Categories

Resources