Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7906863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:09:49+00:00 2026-06-03T11:09:49+00:00

In my java web project,there are code like <T> , in ant script, javac

  • 0

In my java web project,there are code like <T> , in ant script, javac use JDK to compile java code, and it can’t compile success.

Later,I know it must use eclipse JDT to compile.

And, in eclipse, ant script can run success.when run like this:

Right key click build.xml —> Run —> Run as —> External Tools Configurations,click JRE,select “Run in the same JRE as the workspace”.

After that, ant can run successful, in eclipse.

But, I want to write a .bat and .sh file to call ant script, to compile,war,deploy and start Tomcat.
So, ant should run from command. I tried more, error happend always:
Class not found: org.eclipse.jdt.core.JDTCompilerAdapter

PS, I have copy jar files about JDT in eclipse plugin to ant_home/lib directory.

Wish your response. Thanks in advance!

build.xml

`

<tstamp>
    <format property="build.time" pattern="yyyy-MM-dd" />
</tstamp>

<path id="project.classpath">
    <fileset dir="${lib.dir}">
        <include name="**/*.jar" />
    </fileset>
    <fileset dir="${catalina.home}/lib">
        <include name="*.jar" />
    </fileset>
    <fileset dir="${ant.dir}">
        <include name="**/*.jar" />
    </fileset>
</path>

<target name="clear">
    <delete dir="${build.dir}" />
    <delete dir="${dist.dir}" />
    <delete file="${catalina.home}/webapps/${webapp.name}.war" />
    <delete dir="${catalina.home}/webapps/${webapp.name}" />
</target>

<target name="init" depends="clear">
    <mkdir dir="${build.dir}/classes" />
    <mkdir dir="${dist.dir}" />
</target>

<target name="compile" depends="init">
    <echo message="begin compile..." />
    <javac srcdir="${src.dir}" destdir="${build.dir}/classes" 
        includeantruntime="false" nowarn="on" 
        source="1.6" target="1.6" deprecation="true" debug="true" 
        encoding="UTF-8" classpathref="project.classpath">
        <compilerarg line="-Xlint:unchecked" />
    </javac>
    <copy todir="${build.dir}">
        <fileset dir="${src.dir}">
            <include name="**/*.xml" />
            <include name="**/*.properties" />
            <include name="**/*.sql" />
        </fileset>
        <fileset dir="${config.dir}">
            <include name="**/*.xml" />
            <include name="**/*.properties" />
            <include name="**/*.sql" />
        </fileset>
    </copy>
    <echo message="end compile..." />
</target>

<target name="war" depends="compile">
    <echo message="begin war..." />
    <war destfile="${dist.dir}/${webapp.name}.war" basedir="${webRoot.dir}" 
        webxml="${webRoot.dir}/WEB-INF/web.xml">
        <lib dir="${lib.dir}" />
        <classes dir="${build.dir}/classes" />
        <fileset dir="${webRoot.dir}">
            <include name="***.*" />
        </fileset>
    </war>
    <echo message="end war..." />
</target>

<target name="deploy" depends="war">
    <echo message="begin deploy..." />
    <copy file="${dist.dir}/${webapp.name}.war"    todir="${catalina.home}/webapps" />
    <echo message="end deploy..." />
</target>

</project>

`

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:09:51+00:00Added an answer on June 3, 2026 at 11:09 am

    Don’t use the ant from eclipse IDE for usage from command line.

    Download ant separately and extract it somewhere like – C:\apache\ant – for windows, and put its bin directory in your PATH. It’ll come with some jars that will need to be added to your CLASSPATH too.

    For Mac OSX ‘sudo port install ant” takes care of everything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project to convert an existing Java web application to use
I am using hudson CI to manage a straight java web project, using ant
I have a scenario where the base project consists of java code and web
We are working on Java web project based on JPA 2, Hibernate, Spring 3
I am attempting to build a Java web project on NetBeans 6.8, but I
I am starting a new Java web project that will be worked on by
We are starting a new java web-project with Cassandra as the database. The team
I need to implement Online Help in my Java Web Project. For Example User
I have recently created a web project in Java using eclipse. I have a
I am inheriting a project involving a Java web app whose backend is powered

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.