facebook

trouble with ant

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #229100 Reply

    fermataintl
    Member

    I just got an existing project from a client that requires ant in order to build. I have lots of experience using ant with vi on a linux system, but I have switched over to using the IDE to do everything (haven’t figured out remote deployment yet). I love it.

    Anyway, getting back to the problem at hand, I cannot build this project with ant because its looking for the servlet stuff (e.g., javax.servlet.ServletException) and cannot find it. Somehow, MyEclipse finds it in my other projects. In those I am deploying and running tomcat inside MyEclipse. I got so I can run ant inside the ide but its not finding the servlet stuff. I attempted to set CATALINA_HOME to C:\Documents and Settings\Dean\Desktop\eclipse-SDK-3.0.1-win32\eclipse\plugins\org.eclipse.tomcat_4.1.30, but that didn’t seem to help. I even attempted to add servlet.jar as an external. It went OK in the tool but debug output from ant says:
    dropping C:\Documents and Settings\Dean\Desktop\eclipse-SDK-3.0.1-win32\eclipse\plugins\org.eclipse.tomcat_4.1.30\common\lib\servlet.jar from path as it doesn’t exist

    What am I doing wrong?

    Thanks.
    Dean

    #229114

    Riyad Kalla
    Member

    Dean,
    The core problem here is that you might be assuming too much of a connection between Ant and Eclipse when it is run from the IDE, so let me clarify: when you fire up an Ant script in Eclipse, it is launched in an external instance of Java, so it is no different than launching it from the command line… so forget about any continuity between how your Eclipse project is setup and how the Ant script runs.

    If you get into the habit of writing your Ant scripts to run from the command line, then that will take care of the issue. In the case of building this app, I’m not surprised that these JARs are required, just point to the jsp-api.jar and servlet-api.jar files from your Tomcat install that you are deploying to, that will take of the problem.

    Don’t point to the Tomcat install that you found under Eclipse’s plugin dir, this version is a trimmed down Tomcat that is used exclusively for hosting the help files, it is not what is actually run when you use MyEclipse (unless, I guess, you configured it that way). What we intended you to do is go download Tomcat from Jakarta’s site and install it someplace else (c:\Java\tomcat5.0 for example) and then setup the connector to launch that instance. So in your ant script point at the 2 files I mentioned in c:\Java\Tomcat5.0\common\lib and include them in your <classpath>, so your targets compile.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: trouble with ant

You must be logged in to post in the forum log in