Hi all, A simple project,the external jar file is specified with CLASSPATH variable in the project's build.xml file.So the build can work well.But the Eclipse JDT still perform the checking syntax operation:There's red cross error sign at the "import my.lib.*" line. Question:How can I disable the checking syntax(I don't want to add external jars in the project properties tab,since it's already specified in build.xml)?
Jeanne, I'm using ant in Eclipse for the sample project.All ant build tasks(like compile,clean,dist) are executed successfully in the Eclipse Ant View.But in the java source file editor,Eclipse still prompt me:The import my.lib.* cannot be resolved. If I migrate one Java project into Eclipse,should I add tens of external jars into Eclipse project properties by hand(Even though I completely use Eclipse ant view to build the project)?
Xu, Now I see what you are trying to do. You can actually turn off the Eclipse build, since you are using Ant. And in project level preferences, remove the java builder from the list of external builders. (You could replace this with your ant build if you want or just delete it.) Then Eclipse will no longer attempt to compile.
Joined: Nov 16, 2001
Jeanne, That's exactly the way I have tried.In project level preferences,I uncheck "Java Builder" in 'Builders config table'(it's impossible to remove),and new an 'ant builder'.I confirm I've disabled the 'Build automatically' option as well. But it still reports:"The import my.lib cannot be resolved".
Xu, I think it might be remembering from a previous compile. Try deleting the .class files and rebuilding with Ant.
Joined: Nov 16, 2001
Jeanne, Triled but failed again. I checked the help document:Workbench User Guide-->Ant & external tools tutorial-->Use cases for Ant in Eclise-->Ant buildfiles as project builder-->Creating a project builder Ant buildfile. I can find in last paragraph of this page:"internal Eclipse Java compiler which in turn is responsible for indexing your source so that searching, refactoring and many other features are available. Thus it is not possible to replace the internal Eclipse Java compiler by using a project builder". It seems that the default Java Builder is always mandatory though the last line in the page says 'you can disable the Java Builder'. Anyway,my decision:Come back to the jEdit's ant plugin.Currently flexibility is more convenient than integration for me(compare jEdit with Eclipse). Thanks a lot for your comments.
Regards, Xu Song
subject: disable checking syntax(When using ant with Eclipse)