Compile and launch from command line [message #1747112] |
Wed, 09 November 2016 09:28  |
Eclipse User |
|
|
|
Hello,
I want to compile OT/J programs from the command line. But no matter how I set it up I keep getting the error that the BatchAnnotationProcessor is not on the class path.
Unable to load annotation processing manager org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager from classpath.
The first command is java -jar lib/ecotj-R-2.5.0-201606070953.jar -1.8 -cp lib:/Applications/Eclipse.app/Contents/Eclipse/plugins/ src/otongraal/Mainclass.java and the ant file is called with
ant build -lib lib/ecotj-R-2.5.0-201606070953.jar -Dotre.jar=lib/org.eclipse.objectteams.runtime_2.5.0.201606070956.jar <?xml version="1.0" encoding="UTF-8"?>
<project name="otongraal" default="build" basedir=".">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
<!-- adjust this to your project's requirements: -->
<target name="build">
<mkdir dir="bin" />
<property name="user.cp" value="/Applications/Eclipse.app/Contents/Eclipse/plugins/" />
<javac srcdir="src" destdir="bin" classpath="${otre.jar):${user.cp}" source="1.8" target="1.8" />
</target>
</project>
What I have is both an ant build script and a single command which should both do the same. They both result in the same error message.
As you can see I added the Eclipse plugin directory into the class path where jdt.internal.compiler.apt is contained. I have read all the provided information about compiling from command line.
The lib folder contains the required runtime jars, the OT compiler. Building from within Eclipse is fine. When build from within Eclipse and running from command line
java -Xbootclasspath/a:${OTRE_MIN}:${BCEL} -javaagent:${OTRE_AGENT} -cp lib:bin otongraal.Mainclass
I get the error
Exception in thread "main" java.lang.IncompatibleClassChangeError: Class otongraal.Person does not implement the requested interface org.objectteams.IBoundBase2
at otongraal.Company$__OT__Employee.<init>(Company.java:23)
at otongraal.Company._OT$liftTo$Employee(Company.java:23)
at otongraal.Company.approveApplication(Company.java:37)
at otongraal.Company.receiveApplication(Company.java:34)
at otongraal.Mainclass.main(Mainclass.java:12)
For convenience I added all files as zip (but be aware of the hardcoded class path entries).
I want to be able to build from command line (would be a plus) and run from command line (mandatory). For now I tried everything that has been documented in the wiki, the blog and what I found in this forum. Thank you very much for your help.
[Updated on: Wed, 09 November 2016 09:29] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05684 seconds