Ant in eclipse

when i use ant in eclipse.
it says
[javac] BUILD FAILED: file:D:/JavaProject/ACS/testAnt.xml:18: 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
but i set the classpath as follow:
CLASSPATH
.;d:\j2sdk1.4.1_01\lib\dt.jar;D:\j2sdk1.4.0_01\lib\tools.jar
JAVA_HOME
D:\j2sdk1.4.0_01
Path
......;D:\j2sdk1.4.0_01\bin;.;D:\j2sdk1.4.0_01\lib\dt.jar;D:\j2sdk1.4.0_01\lib\tools.jar
how to slove that?

Thanks for the solution E13, that fixed the same problem I was having. However, I'm thinking that this might be an Eclipse-specific bug, and not due to a shortcoming on M$ part (for once :)
The reason I say this, is that when I was trying to debug this problem, I noticed that Eclipse kept wanting to set its internal java.home to the location of the System JRE (which was J2SDK1.4.2 in my case - run 'ant -diagnostics'). So I'm assuming that when it looked under ${java.home}/bin, it didn't find the javac compiler and failed.
What's strange, is that no matter what I tried, I couldn't get Eclipse's Ant tool to point to a different java.home. My system JAVA_HOME is set correctly, but eclipse apparently clobbered it. I tried overwriting this value in the properties sheet to no avail. Even after applying your solution, the code compiles fine, but java.home is still pointing to the wrong directory.
Is eclipse querying the Registry for Ant's java.home?? I grepped all the xml resource and property files in my Eclipse install dir looking for where this value was assigned, but it isn't there. Is anyone else seeing this problem? I'll probabally open up a Bug on Eclipse since this doesn't appear to be correct behavior.

Similar Messages

  • How to compile Java files using Ant in Eclipse

    Hi All ,
    I would like to compile all Java files using Ant in Eclipse.Since am very new to Ant and Eclipse can someone help me to create a build.xml file and let me know how to compile all the java files.
    For ex , I have placed my java files inside the path C:\HEC\Terab.Initially the Terab folder holds 7 jar files which i had decompiled using JD compiler and placed the unzipped 7 folders (which contains the java files ).Now i have imported the HEC project into Eclipse using New ->Project ->Java Project.after importig it throwed me an error saying missing jar files.again i copied the jar files and placed inside Terab folder with other 7 folder.
    Now How i can compile the java files and convert in to class files.Then after compiling the files i will again need to jar all the 7 folder.
    Please tell me the steps i need to follow.How to write an build.xml file ? where i should keep it ? only one build.xml file is enough or should i write 7 build.xml file for each folder ? Please help me out...
    Thanks & Regards
    Kar1983

    put it another way, what I am trying to do is to compile David Brackeen's ch 18 code from his book. The java sourse files can be downloaded here:
    http://www.brackeen.com/javagamebook/
    my question is that how would I complie all of these file so that I can get the program in ch18src\src\com\brackeen\javagamebook\test\ to run?

  • Running a JUnit test case using Ant in Eclipse

    If I have a "JUnit", how can I run it using "Ant" in Eclipse?
    Thanks.

    Right-click on the ant build script and select "Run as ant build". But why bother? Eclipse has its own JUnit runners

  • Building jars using ant and eclipse

    Note: If this post could be in a more appropriate forum category could someone please tell me which one is better.
    Vexing issue:
    I am using ANT so that it will take care of which classes have been modified and therefore which jars need to be updated.
    I noticed one way ANT can work is to look at the timestamp of the class files and then build the necessary jars. This works fine EXCEPT that eclipse has a nasty habit of sometimes recompiling everything, even when I dont ask it to. It would seem to make more sense basing the recompilation on the source files, and whether they have been modified. So I set this up with my build.xml, ie
    <target name="compile" depends="init"
    description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" fork="true"/>
         </target>
    Now suppose I go and change one of my source files, ANT recompiles that file and that all works great. However, suppose that file had in it, which many do,
    public static String EXAMPLE_VARIABLE = "example";
    This static variable is referenced in many classes, and yet ANT only recompiles the one file, and thus there begins an inconsistency!
    Is there any way to get around this? I would have expected ANT to recompile all the files that depend on the class with the static variable but it doesnt.
    Any help much appreciated.
    Cel

    You know, that's a good question. I would think JVMs at runtime could resolve static variables, like when it compiles classes using that static variable it puts a placeholder "Hey, here I am using XXX, at runtime, figure it out and give me the value right at the start..". But I think it works like you suggest in that a static value is compiled into every location that uses it. The only thing I can think of is provide a target for a build-all in your ant and have it rebuild all.
    I agree though that the javac compiler should be smarter in how it compiles classes. Anytime a class has certain attributes that may be compiled in to other classes, it should check and recompile any class that depends on the static value that has changed.

  • How to increase memory for building project using ant in ECLIPSE

    Hi All,
    for all java projects and java applications in eclipse i am giving -Xms and -Xmx to increase heap memory.
    But the same failed when i run ant. it says Out of Memory Error.eventhough i had 1GB ram in system.
    How to increase memory for Building through ANT.
    Thanks,
    J.Kathir

    even if this is not a eclipse forum
    In the package explorer view or navigator view right click on the build file select "Run as / Ant Build ...". On the JRE Tab you can enter the VM Aguments like -Xmx512m
    Consult the java dokumentation how to set the memory of the jvm.

  • Ant in Eclipse Builds a Corrupt JAR

    When I build a JAR file in Eclipse using an Ant build file, the resulting JAR is corrupt. It cannot find the main class. Repairing the JAR using WinRAR fixes this issue. WinRAR reports repairing corrupt header information. This issue does not occur when manually exporting a JAR from Eclipse. In all cases, we are using the same manifest file. The Ant compile does not show any warnings or errors. The exact runtime error when executing the corrupt JAR is: "Could not find the main class. Program will exit."
    I am relatively new to Ant. I have searched the forums and google, but I have been unable to find anyone describing similar issues. I have spent three weeks trying to make this code work. None of the tutorials or FAQs I have found mention this issue, and none of the techniques they describe resolve it. Do you have any idea what might be causing this issue, or how to resolve it? The main reason I want to use Ant is to automate our build process. We can't do that if we have to manually repair the resulting JAR file after each build. I'm probably missing something obvious, but I don't have the Ant experience to know what that is. Any help would be greatly appreciated.
    Ant Version: 1.7
    Eclipse Version: 3.3.1.1
    Java Version: 1.6.0.3
    Platform: Windows XP (SP2)
    My build file (replacing my login with 'username' for privacy purposes):
    <?xml version="1.0" encoding="utf8"?>
    <project name="ecsMerlinJarBuild" default="MakeMerlinJar" basedir=".">
    <target name="Initialize" description="delete old .class files">
    <delete dir="JavaSource\com\ebsco\component" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\core" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\dao" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\datatype" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\dto" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\interfaces" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\module" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\parents" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\process" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\screen" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\util" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\window" includes="*.class" />
    <delete dir="JavaSource\com\ebsco\windowwrapper" includes="*.class" />
    </target>
    <target name="Compile" description="Compile .java files">
    <javac srcdir="JavaSource\com" includes="ebsco\**\*.java" bootclasspath="C:\\Program Files\\Java\\jre1.6.0_03\\lib\\rt.jar" classpath="C:\\Documents and Settings\\username\\workspace\\merlin\\IBMLibraries.jar" />
    </target>
    <target name ="MakeMerlinJar" description="Create a jar for the Merlin project">
    <jar jarfile="Merlin.jar" excludes="*.jar, *.zip" manifest="MANIFEST.txt" update="true" duplicate="fail" >
    <zipfileset dir="JavaSource\com\ebsco\component" includes="*.class" prefix="com\ebsco\component" />
    <zipfileset dir="JavaSource\com\ebsco\core" includes="*.class" prefix="com\ebsco\core" />
    <zipfileset dir="JavaSource\com\ebsco\dao" includes="*.class" prefix="com\ebsco\dao" />
    <zipfileset dir="JavaSource\com\ebsco\datatype" includes="*.class" prefix="com\ebsco\datatype" />
    <zipfileset dir="JavaSource\com\ebsco\dto" includes="*.class" prefix="com\ebsco\dto" />
    <zipfileset dir="JavaSource\com\ebsco\interfaces" includes="*.class" prefix="com\ebsco\interfaces" />
    <zipfileset dir="JavaSource\com\ebsco\module" includes="*.class" prefix="com\ebsco\module" />
    <zipfileset dir="JavaSource\com\ebsco\parents" includes="*.class" prefix="com\ebsco\parents" />
    <zipfileset dir="JavaSource\com\ebsco\process" includes="*.class" prefix="com\ebsco\process" />
    <zipfileset dir="JavaSource\com\ebsco\screen" includes="*.class" prefix="com\ebsco\screen" />
    <zipfileset dir="JavaSource\com\ebsco\util" includes="*.class" prefix="com\ebsco\util" />
    <zipfileset dir="JavaSource\com\ebsco\window" includes="*.class" prefix="com\ebsco\window" />
    <zipfileset dir="JavaSource\com\ebsco\windowwrapper" includes="*.class" prefix="com\ebsco\windowwrapper" />
    <zipfileset dir="." includes=".classpath, .project, *.txt, *.xml" />
    </jar>
    </target>
    <target name="CopyJarFile" description="Copy the Merlin jar file to the set destination">
    <copy file="Merlin.jar" todir="C:\\Documents and Settings\\username\\Desktop\\JARs"/>
    </target>
    </project>

    And presumably that class actually exists? I can't see any reason why this build file wouldn't work, although I don't know why you're using zipfilesets. Maybe that's the problem. Another option is to export the jar from Eclipse, and ask it to generate an Ant script at the same time.
    But really, you ought to have a look at some [Ant tutorials|http://ant.apache.org/manual/index.html] , or better yet, get your company to buy a copy of [this book|http://www.amazon.co.uk/Java-Development-Ant-Erik-Hatcher/dp/1930110588/ref=sr_1_3?ie=UTF8&s=books&qid=1210364234&sr=8-3] because you're making more work for yourself than you need to here. For instance, you can use "**/*" to recursively include entire directory trees, rather than explicitly include each one

  • Weblogic.jspc outofmemory error while compiling jsps using ant in eclipse

    Hi all,
    I am trying to execute this target in my ant build:
         <target name="jspc">
              <java classname="weblogic.jspc" fork="yes">
                   <arg line="-verbose -verboseJavac -compileAll -webapp ${project.jsp.dir} -d ${project.jsp.class.dir}" />
                   <classpath>
                        <pathelement path="${classpath}" />
                   </classpath>
         </java>
         </target>
    I am getting the following error:
    [java] Error: [jspc]: 0 file(s) failed:
    [java] [Compilation errors : ]
    [java] The system is out of resources.
    [java] Consult the following stack trace for details.
    [java] java.lang.OutOfMemoryError
    [java] at weblogic.jspc.doCompile(jspc.java:861)
    [java] at weblogic.jspc.runJspc(jspc.java:654)
    [java] at weblogic.jspc.runBodyInternal(jspc.java:412)
    [java] at weblogic.jspc.runBody(jspc.java:319)
    [java] at weblogic.utils.compiler.Tool.run(Tool.java:192)
    I am using weblogic 8.1, eclipse3.1, java1.4.1.
    Can some one please help me with this issue?
    thanks in advance.

    --> some error on posting please refer to the next post...
    From the error logs we can trace it out to the web project's Build.xml file ....I was getting a similar error and by commenting out the following lines in the web project's Build.xml I am able to run the build script correctly and get a EAR file. The lines are
    <!--
    <assemble
    moduleDir="${generated.module.root}"
    moduleName="${project.name}"
    srcOutputDir="${assembly.src}"
    appRootDir="${ear.root}">
    <assemblyContext factory="org.apache.beehive.controls.runtime.assembly.WebAppAssemblyContext$Factory" />
    <assemblyContext factory="org.apache.beehive.controls.runtime.assembly.AppAssemblyContext$Factory" />
    <classpath refid="assembly.classpath" />
    <fileset dir="${project.dir}">
    <include name="**/*.controls.properties" />
    </fileset>
    </assemble>
         -->
    Please check it now, also if any one can let us know the function or role played by the above lines it would be great. Also if there would be any future or unseen problems by commenting out these lines please do let us know...
    Thanks
    -MiM
    Edited by prodigymonish83 at 10/22/2007 5:56 AM

  • Packaging JAR's using Ant in Eclipse

    Hey,
    I'm new to Ant, and xml for that matter. I need to rmi compile & package a set of simple classes whose objects call eachother remotely. I need seperate jars for a "server" and one for "client" containing whatever classes are needed for each. Using Ant the classes should be compiled, packaged into the jars and then the jars should be copied to some other specified directory. And of course, the jars should be executable.
    The files I use are AddressBook (interface extends Remote), AddressBookImpl (extends UnicastRemoteObject implements AddressBook), BuddyInfoInterf (interface extends Remote), BuddyInfo (the implementation, extends Unicast... implements BuddyI...), and AddressBookUser.
    The AddressBook is created on the server-side (in main() found in AddressBookImpl) and is populated with BuddyInfo's also created server-side.
    AddressBookUser is just the client accessing some info from ABook or BInfo.
    So, anyway, here's the xml file I've written to do the tasks assigned. The classes compile fine, and the jar files seem to contain the proper files. My problem is that the jar files don't execute properly. The main() in AddressBookImpl creates the ABook and binds it to the rmiregistry. When I run the server.jar that is "initially" created during the process (the one in the base dir) it works fine but this only seems to work correctly because it's in the same dir as all of the compiled classes. The copied jar file in the other directory, or even if I manually copy the server.jar file in the base dir to some other dir, causes an exception when trying to bind the AddressBook to the registry saying it can't find a stub that is definitely located in the jar. And I'm running the rmiregistry in whatever dir the server.jar is in each time:
    Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
    server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: AddressBookImpl_Stub
    at sun.rmi.server.....
    <?xml version="1.0"?>
    <project default="packaging">
    <!-- Change location(s) to desired path(s) where client and/or
    server jar files should be copied to, else will create folders
    "client" and "server" in project directory and copy them to
    there. -->
    <property name="serverDir" location="./server"/>
    <property name="clientDir" location="./client"/>
    <!-- performs all tasks -->
    <target name="packaging">
         <!-- Compiles all files in project directory. Necessary for
         AddressBookUser.java to be compiled -->
         <javac srcdir="."/>
         <!-- RMI compiles AddressBookImpl & BuddyInfo -->
         <rmic classname="AddressBookImpl" base="."/>
         <rmic classname="BuddyInfo" base="."/>
         <!-- Creates server jar file -->
         <jar destfile="./server.jar" basedir="." includes="**.class" excludes="AddressBookUser.**">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookImpl"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- Creates client jar file -->
         <jar destfile="./client.jar" basedir="." includes="**.class" excludes="AddressBookImpl.** BuddyInfo.** **Skel.class">
              <manifest>
                   <attribute name="Main-Class" value="AddressBookUser"/>
                   <attribute name="Class-Path" value="."/>
              </manifest>
         </jar>
         <!-- copy jar files to specified directories -->
         <copy file="./server.jar" todir="${serverDir}"/>
         <copy file="./client.jar" todir="${clientDir}"/>     
    </target>
    </project>
    Sorry bout the length. Just want to cover my bases. Thanks for any help.

    I am also having problem in building server.jar file using Ant. I am using EJB jar file in my web application, this jar file is called remotely from server to client. Client.jar file working correctly but the server.jar file contains error which is given below:
    15:30:47,296 WARN [verifier] EJB spec violation:
    Bean : Server
    Section: 22.2
    Warning: The Bean Provider must specify the fully-qualified name of the Java cla
    ss that implements the enterprise bean's business methods in the <ejb-class> ele
    ment.
    Info : Class not found on 'com.ejb.ServerBean': No ClassLoaders found for: com.ejb.ServerBean
    15:30:47,296 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.4.GA/server/default/deploy/server.jar
    org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
    In above error, "Class not found on 'com.ejb.ServerBean' " is given. Will there be all the classes of EJB jar file in server.jar ? I think only the interface class file i.e. Server.class and serverHome.class must be included, am I correct or not?
    Also the build.xml which I am using for creating server.jar is given below:
    <project name="ServerEJB" default="make_server_jar" basedir=".">
    <!-- Initialization variables -->
    <property environment="env" />
    <property name="app.name" value="${ant.project.name}"/>
    <property name="source.dir" value="ejbModule"/>
    <property name="build.dir" value="build"/>
    <property name="classes.dir" value="${build.dir}/classes"/>
    <property name="distribution.dir" value="dist"/>
         <property name="server.ejb.jar.name" value="server.jar"/>
    <target name="clean" description="Deletes compiled and generated code">
    <delete dir="${build.dir}"/>
    </target>
    <target name="make_server_jar" depends="" description="Builds a server.jar with stubs for apps to use">
    <mkdir dir="${distribution.dir}" />
    <jar destfile="${distribution.dir}/${server.ejb.jar.name}" basedir="${classes.dir}">
         <exclude name="**/*Bean.class"/>
    </jar>
    </target>     
    </project>
    I am using server.jar file in server as interface which will remotely call client.jar which will be kept at client location.
    Anybody, can you provide me with the solution for this problem?...
    Thank you.

  • Problem in reloading project using ANT in Eclipse

    Hello Friends,
    I have created one application in which i just put one jsp page and the application is based on Strtus.
    for loading project in tomcat i have done following step,
    all,install
    now for next time after changes made in jsp page i have perform all,reload
    but it will give me the error.
    BUILD FAILED
    *<Path of projct> \build.xml:192: FAIL - Encountered exception java.lang.NoSuchMethodError: org.apache.commons.logging.LogFactory.release(Ljava/lang/ClassLoader;)V*
    Total time: 30 seconds
    but for loading project i perform all,remove,install
    so now i have to perform 3 steps each time.
    anyone know about the above problem.
    i have put common-logging.jar file and in that there is a release method which is abstract.
    Thanks in advance,
    Ajay Patel

    Continueee....on above...
    when i perform all,remove,install for reinstalling application on tomcat,
    i also got same error while performing remove operation but still it delets from tomcat.
    And when i perform all,remove
    it gives me
    reload:
    *[reload] FAIL - Encountered exception java.lang.IllegalStateException: Container StandardContext[EventManagementSystem] has not been started*
    BUILD FAILED
    *C:\Documents and Settings\Ajay\Desktop\ajay\JspWorkspace\EventManagement\build.xml:192: FAIL - Encountered exception java.lang.IllegalStateException: Container StandardContext[EventManagementSystem] has not been started*
    Total time: 2 seconds
    can anyone know about this.....how can i solve the LogFactory error.
    Thank You in advance,
    Ajay Patel

  • Ant, eclipse help is needed please!!

    Hi all,
    I have a quick question in regard of ant and eclipse. If any of you know how to resolve this problem, please let me know . ok so the problem is the following.
    Is there a way to use Apache ANT to compile and execute a particular file in eclipse without specifying the class name? I can do that in cygwin using VIM with the command %:t:r However, I haven't found the solution to do so in eclipse. Any idea or tip or solution is appreciated very much.
    i.e. I can do this in cygwin. ant -target=%:t:r run this will automatically pick up the java file that I am currently working on and run it without telling ant which class I want to run. SO I would like to do the same in eclipse.
    Take care and God bless!

    Originally posted by: gregg.newatlanta.com
    Ahhh, commons-net.jar!! That was the ticket. Thanks for your patience.
    I had jakarta-oro-2.0.8.jar (which seems to work fine) but not
    commons-net.jar !!
    Thanks again!
    Gregg
    > The JARs you are seeing are the Ant JARs that make use of the library
    > dependancies.
    >
    > You will need the JARs as outlined in
    > http://ant.apache.org/manual/install.html#librarydependencie s.
    >
    > You will need the jakarta-oro-2.0.7.jar from http://jakarta.apache.org/oro/
    > and the commons.net JAR from
    > http://jakarta.apache.org/commons/net/index.html
    >
    > HTH
    > Darins
    >
    > "Gregg Orangio" <[email protected]> wrote in message
    > news:cnd180$5r7$[email protected]..
    >
    >>Thanks for the reply. However, it appears to me that Eclipse 3.0 does
    >>ship with these library dependencies. The Ant Home Entries in the
    >>runtime classpath shows the following libraries:
    >>
    >>.../plugins/org.apache.ant_1.6.1/ant-commons-net.jar
    >>.../plugins/org.apache.ant_1.6.1/ant-jakarta-oro.jar
    >>
    >>These Jar files do indeed exist on the Eclipse installation. Are these
    >>not the correct versions to allow the "telnet" task to be recognized?
    >>
    >>even though it appears to me that something else is wrong, I went ahead
    >>and installed newly downloaded versions of ant-commons-net.jar and
    >>jakarta-oro-2.0.8.jar from the Ant website. Adding these to either the
    >>Ant Home Entries or the Global Entries does not correct the problem.
    >>
    >>Please help.
    >>
    >>
    >>
    >>Darin Swanson wrote:
    >>
    >>>The telnet task (as an optional task) has library dependencies that do
    >
    > not
    >
    >>>ship with Ant.
    >>>
    >>>See http://ant.apache.org/manual/install.html#librarydependencie s
    >>>
    >>>For telnet you need commons-net.jar and jakarta-oro 2.0.1.jar
    >>>
    >>>Likely your best solution is to add these JARs to the global Ant runtime
    >>>classpath via the Ant preferences.
    >>>
    >>>HTH
    >>>Darins
    >>>
    >>
    >
    >

  • How to configure ant in my eclipse

    Hi,
    i have ant-1.7 in C:\Training\apache-ant-1.7.0,but in eclipse , the build.xml run as was not showing any ant. why?
    should i must configure my ant or eclipse.can anyone helpme.Iam using Eclipse 3.5 galileo.

    Hi,
    1. Make sure that you set ANT_HOME environment variable.
    Ex: ANT_HOME = C:\eclipse\plugins\org.apache.ant_1.7.1.v20090120-1145
    2. In eclipse, select your project. Then select Run -> External Tools ->External Tools Configurations...
    3. In the dialog that opens, select Ant Build in the left panel. Click the New button (New launch configuration).
    4. In the right panel, select the Main tab (It is selected by default). Give the path to your build.xml that you want to use.
    You can choose targets using the Targets tab after specifying the build.xml.
    5. Go to the Classpath tab. Click the Ant Home button in the right side and set the Ant home correctly.
    It should be added as User Entries in the Classpath.
    6. Save this configuration and run this for your project.
    Hope this helps.
    Keep posting the updates/ questions.
    Thanks,
    Gopinath Ramasamy

  • Problem with compiling build.xml ( ANT tools)  in Eclipse

    I was trying to compile my project thru ANT within eclipse...and it gave me error:
    Cannot use classic compiler, as it is not available A common solution is to set the environment variable JAVA_HOME to your jdk directory.
         at org.apache.tools.ant.taskdefs.compilers.Javac12.execute(Javac12.java:96)
         at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:557)
         at org.apache.tools.ant.Task.perform(Task.java:217)
         at org.apache.tools.ant.Target.execute(Target.java:184)
         at org.apache.tools.ant.Target.performTasks(Target.java:202)
         at org.apache.tools.ant.Project.executeTarget(Project.java:601)
         at org.apache.tools.ant.Project.executeTargets(Project.java:560)
         at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:262)
         at java.lang.reflect.Method.invoke(Native Method)
         at org.eclipse.ant.core.AntRunner.run(AntRunner.java:233)
         at org.eclipse.ui.externaltools.internal.core.AntFileRunner.execute(AntFileRunner.java:59)
         at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.executeRunner(DefaultRunnerContext.java:413)
         at org.eclipse.ui.externaltools.internal.core.DefaultRunnerContext.run(DefaultRunnerContext.java:464)
         at org.eclipse.ui.externaltools.internal.ui.AntLaunchWizard$1.run(AntLaunchWizard.java:117)
         at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:98)
    Build exception: E:\MyPrograms\ejb\MEJB\Hello\build.xml:33: Cannot use classic compiler, as it is not available A common solution is to set the environment variable JAVA_HOME to your jdk directory.
    I already set my JAVA_HOME with jdk1.3.1, but end up with the same error. JRE 1.3.1_07 is installed on my machine and my project contains the installed jre. It appears in both Project properties dialog box and in Installed JRE tab JAVA BUILD PATH of preferences...
    my ANT compilation works fine with command line.
    Please Help !!

    have you did some wrong with the build output path?
    i am dont understand clearful.but i am think so ;
    example :
    the eclipse's default build out path is 'bin',
    so,if you compile by this code:
    <target name="compile">
    <mkdir dir="./class" />
    <javac srcdir="./src" destdir="./class"
    classpath="com.Ostermiller.util.*"
    encoding="${ENCODING}"
    debug="on" optimize="off" deprecation="off" />
    </target>
    * the "ENCODING" 's value is setting in the properties file.
    you will maybe get the 'Cannot use classic compiler' error only.
    you can change the build output path ,or use the default path ;
    I am sorry ,
    I was limited in English and was a bigginer of java ,
    so that i cant to talk Clearly.
    if it cant working fine ,please mail to me :[email protected]
    good luck!
    Kou.huang

  • ClassCastException using Subant and wldeploy ant task

    Hi!
    I'm using subant to call all diffrent build.xml files located in subdirectories. The buildfile looks like this:
    <project name="extern.call" default="callall">
         <target name="callall">
              <fileset      id="buildfile.set" dir=".." includes="*2/build.xml">
                   <exclude name="Br*2/*"/>
              </fileset>
              <subant target="deploy-local" inheritall ="false" failonerror="true">
                   <fileset      refid="buildfile.set"/>
              </subant>
         </target>
    </project>
    The first called build.xml files works fine ... but the execution of the second build.xml (it's not important which file is the second one, it's crash always at the second call), stop with a "java.lang.ClassCastException".
    See Stacktrace:
    [subant] weblogic.Deployer -debug -nowait -verbose -upload -noexit -name ClarifyRead -source \build\ClarifyRead\delivery\ClarifyRead.ear -targets myserver -adminurl t3://localhost:7001 -user weblogic -password ******** -deploy
    [subant] dumping Exception stack
    [subant] java.lang.ClassCastException
    [subant] at weblogic.management.deploy.utils.DeployerHelper.uploadSource(DeployerHelper.java:586)
    [subant] at weblogic.Deployer.runBodyWithAuthenticatedSubject(Deployer.java:824)
    [subant] at weblogic.Deployer.runBody(Deployer.java:711)
    [subant] at weblogic.utils.compiler.Tool.run(Tool.java:146)
    [subant] at weblogic.utils.compiler.Tool.run(Tool.java:103)
    [subant] at weblogic.Deployer.runMain(Deployer.java:566)
    [subant] at weblogic.Deployer.mainWithExceptions(Deployer.java:576)
    [subant] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [subant] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [subant] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [subant] at java.lang.reflect.Method.invoke(Method.java:324)
    [subant] at weblogic.ant.taskdefs.management.WLDeploy.invokeMain(WLDeploy.java:264)
    [subant] at weblogic.ant.taskdefs.management.WLDeploy.execute(WLDeploy.java:204)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:65)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:340)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:65)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:340)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.Target.execute(Target.java:301)
    [subant] at org.apache.tools.ant.Target.performTasks(Target.java:328)
    [subant] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [subant] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
    [subant] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:182)
    [subant] at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:112)
    [subant] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [subant] at org.apache.tools.ant.Task.perform(Task.java:364)
    [subant] at org.apache.tools.ant.Target.execute(Target.java:301)
    [subant] at org.apache.tools.ant.Target.performTasks(Target.java:328)
    [subant] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [subant] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:379)
    [subant] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
    There is no diffrent between using ant in eclipse environment or as standalone, the result it the same.
    Do someone else have the same problem?
    Kind regards
    Joseph

    Hi
    I got the same message and I couldn't resolve it too, I am wordering if you got the key to the problem?
    Thanks
    Daivd Huang

  • Wsgen as ant task doesn't recognize

    Hi
    I'm trying to build my webservice using ant in eclipse but ant doesn't regonize this kind of task
    my java files are in src catalouge and my build file looks like this
    <?xml version="1.0" encoding="UTF-8"?>
    <project name = "webservice">
    <property name = "build.dir" location="build.classes"/>
    <target name="init">
         <mkdir dir="${build.dir}"/>
    </target>
    <target name = "compile" description = "Kompiluje kod javy">
         <javac srcdir = "src" destdir = "build/classes"/>
    </target>
    <target name="generate">
    <wsgen destdir = "${build.dir}" sourcedestdir="${build.dir}">
         <classpath>
              <fileset dir = "src">
                   <include name="*.*"/>
              </fileset>
         </classpath>
    </wsgen>
    </target>
    </project>and i want to ask too, if iam using wsgen do i need to compile classes before, if someone could write some example buildfile i will be thankfull, i tryied to understand build file from the examples from sun's tutorial but the are too complicated for me

    Don't you need to declare the wsgen task somewhere?

  • Debug aplication started using ant

    Hello,
    I wonder if it is possible to stop and debug an aplication in a breakpoint when this aplication was started using ant from eclipse as IDE. I use eclipse ver. 3.0.
    thanks a lot for any help or ideea

    Not all WLST installations are equivalent. Have a read of [http://www.oracle.com/technetwork/articles/adf/part10-085778.html]this, specifically the paragraph right after Figure 13 for something to try. Bottom line - the WLST that comes with the base WLS server install cannot do the MDS operations.
    John

Maybe you are looking for