How to use jdt core instead of ecj for batch compilation

Go To StackoverFlow.com

1

I'm working on a java ide(the ide itself is written in java, non eclipse environment) which currently uses ecj in the backend for compiling java source files. I was tweaking around to see how I could replace ecj with the jdt core, as I want to use some advanced features offered by jdt core components like ast-parser, incremental compile, etc. I replaced ecj.jar with org.eclipse.jdt.core_3.7.1.XXXXX.jar, updated some classpaths, and rebuilt the ide with ant. Now when I compile any java source file from the ide, I get:

java.lang.NoClassDefFoundError: org/eclipse/jdt/core/compiler/batch/BatchCompiler

I've updated the ide's classpath to include the jdt.core jar instead of ecj, and jdt core clearly contains the batch compiler. So what am I missing? Does the jdt.core require additional dependencies for compiling java source files? Or is it a bad idea to use jdt.core instead of ecj in a non-eclipse environment?

2012-04-04 07:33
by Manindra Moharana


0

I've found the solution. The classpath of the launcher needed updating. JDT-core works just fine.

2012-04-11 09:50
by Manindra Moharana
Ads