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 8883971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:57:01+00:00 2026-06-14T20:57:01+00:00

There is the following build.bat file: echo off set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_25 set BUILD_CP=C:\Program Files\Java\jdk1.6.0_25\bin\lib\tools.jar;C:\Program

  • 0

There is the following build.bat file:

echo off  
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_25"  
set BUILD_CP="C:\Program Files\Java\jdk1.6.0_25\bin\lib\tools.jar";"C:\Program Files\Java\jdk1.6.0_25\bin";..\devlib\ant.jar;..\devlib\optional.jar;..\devlib\junit.jar;..\devlib\xercesImpl.jar;..\devlib\xmlParserAPIs.jar;  
"C:\Program Files\Java\jdk1.6.0_25\bin\java" -classpath %BUILD_CP% org.apache.tools.ant.Main -buildfile build.xml all  

set BUILD_CP=  

pause  

When I run it I get:

BUILD FAILED

file:D:/Development/Java/Frameworks/JMeter/TestDemoIbatis/iBATIS_JPetStore-4.0.5/build/build.xml:29: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Total time: 0 seconds
Press any key to continue . . .  

But my JAVA_HOME, PATH is properly set:

enter image description here

Update:
The ant script:

<project name="JPetStore" default="all" basedir=".">  

  <property file="build.properties"/>  

  <path id="classpath">  
    <pathelement location="${src}/"/>  
    <fileset dir="${lib}" includes="**/*.jar" />  
    <fileset dir="${devlib}" includes="**/*.jar" />  
  </path>  

  <target name="clean" >  
    <delete dir="${wars}"/>  
    <delete dir="${webapp}"/>  
    <delete>  
      <fileset dir="${src}" >  
        <include name="**/*.class"/>  
      </fileset>  
    </delete>  
  </target>  

  <target name="prepare" depends="clean">  
    <mkdir dir="${wars}"/>  
    <mkdir dir="${webapp}"/>  
    <mkdir dir="${webapp}/WEB-INF/classes"/>  
    <mkdir dir="${webapp}/WEB-INF/lib"/>  
  </target>  

  <target name="compile" depends="prepare"> //LINE 29 that fails 
    <javac srcdir="${src}" destdir="${webapp}/WEB-INF/classes" deprecation="off" debug="${debug}">  
      <classpath refid="classpath"/>  
    </javac>  
  </target>  

  <target name="assemble.view">  
    <copy todir="${webapp}">  
      <fileset dir="${web}">  
        <include name="**/*.jsp"/>  
        <include name="**/*.html"/>  
      </fileset>  

    </copy>  
  </target>  

  <target name="assemble" depends="compile">  
    <copy todir="${webapp}/WEB-INF/classes">  
      <fileset dir="${src}" >  
        <exclude name="**/*.java"/>  
        <exclude name="**/*.class"/>  
      </fileset>  
    </copy>  
    <copy todir="${webapp}/WEB-INF/lib">  
      <fileset dir="${lib}" />  
    </copy>  
    <copy todir="${webapp}">  
      <fileset dir="${web}" />  
    </copy>  
  </target>  

  <target name="war" depends="assemble">  
    <jar jarfile="${wars}/jpetstore.war">  
      <fileset dir="${webapp}">  
        <include name="**/*"/>  
      </fileset>  
    </jar>  
  </target>  

  <target name="all" depends="war" />  

</project>  

What is the problem here? I am in Windows7/64-bit

  • 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-14T20:57:02+00:00Added an answer on June 14, 2026 at 8:57 pm

    This just worked for me:

    echo off
    
    set JAVA_HOME="c:\Program Files\Java\jdk1.6.0_25"
    
    set BUILD_CP=%JAVA_HOME%\lib\tools.jar;..\devlib\ant.jar;..\devlib\optional.jar;..\devlib\junit.jar;..\devlib\xercesImpl.jar;..\devlib\xmlParserAPIs.jar;
    
    %JAVA_HOME%\bin\java -classpath %BUILD_CP% org.apache.tools.ant.Main -buildfile build.xml all
    
    set BUILD_CP=
    
    pause
    

    Note that I had to change the build.xml to add the source=1.4 directive:

    <javac srcdir="${src}" destdir="${webapp}/WEB-INF/classes" deprecation="off" debug="${debug}" source="1.4">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the Packaging section of Xcode build settings, there are the following options: Compress
I have the following build.xml file setup in phpUnderControl. <target name=phpunit> <exec executable=phpunit dir=${basedir}/httpdocs
can you give me a idea about the following program: There is vehicle factory.
I have a controller called votes_controller.rb . In that file there is the following
I would like to use JavaScript to do the following: Build an XML file
Off the bat, version information: Eclipse: Juno Release, build 20120614-1722 Android: 4.4 ADT: 20.0.0v201206242043-391819
I have the following ant build file which is supposed to package all class
In Visual Studio 2010, under Advanced Build Settings there is the following options for
After following these steps: http://developers.facebook.com/docs/mobile/android/build/ I find that everything goes well, but when I
Let's say there's following directory structure: root | +--projects | | | +-test |

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.