I have a project that i wrote for apache tomcat. I started working with eclipse i want to import the project to eclipse ide.

using eclipse 3.6.1.

when i create a new project using :

File -> New -> Other -> Java -> Java Project from Existing Ant Buildfile and i provide the build file location i get the following error:

Specified buildfile does not contain a javac task

I have a red5 project that i used the same method and it worked. what am i missing? do i need to add something to the ant build file to make it work? what exactly ? where can i find more information regarding this specific subject ?

thanks!

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

I have run into the same problem. Eclipse is looking for the javac, and the present version doesn't know how to unravel it.

My build.xml calls other ant files. An excerpt looks like this:

  <target name="MyProject">
    <ant antfile="project.xml" target="${tgt}">
      <property name="project_name" value="MyProject"/>
      <property name="root_project_dir" value="${root_dir}/SubProj/src"/>
      <property name="cvsroot" value="${cvsroot_SubProj}"/>
      <property name="cvsmodule" value="${cvsmodule_SubProj}/src/MyProject"/>
    </ant>
  </target>

I added a javac task between the </ant> and </target> lines:

<javac srcdir="${root_dir}/SubProj/src" destdir="C:\temp"/>

This gave Eclipse the information it needed: how to find the source files for SubProj. The javac task indicated the directory.

Unfortunately, Eclipse also added a SubProj.src to the package names. I don't know of a way to fix this other than Ctrl-1 on the package name, but this messes up the CVS saves.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.