wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes ANT Complilation Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ANT Complilation Issue" Watch "ANT Complilation Issue" New topic
Author

ANT Complilation Issue

Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Hello,

When I am compiling my project through IntellijIDEA it's compiling successfuly. I written ANT script to compile the code and I have supplied all my lib directory to my ANT but It is not working properly, the errors are like,
1)Class Unknown Exception (java.util.regex.Matcher)
2) Out of memory. Incrase the Maximu heap size (I have already increased in my IDEA but still..)
I wonder why ANT is not picking up all *.jar files from lib directory?

Build.xml
---------

<?xml version="1.0" encoding="UTF-8"?>

<!--Author Sirish Kumar-->
<!--Draft version of ANT Script-->

<project name="TradeWeave" default="compile" basedir=".">
<property name="src" location="SRC"/>
<property name="build-dir" location="SRC/debug"/>
<property name="runtime-libs" location="classes"/>
<property name="was-deployment-dir" location="C:\Program Files\WebSphere\AppServer\installedApps\server1"/>
<property name="server-deployment-dir" location="C:\"/>

<!--First Target:: init-->

<target name="init" description="Initialize the project environment">
<path id="project.class.path">
<pathelement path="${java.class.path}/"/>
<pathelement location="${build-dir}"/>

<fileset dir="${runtime-libs}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<tstamp>
<format property="today" pattern="ddMMyy" locale="en"/>
</tstamp>
</target>

<!--Second Target:: clean-->

<target name="clean" depends="init" description="Delete the contents of the build directory">
<delete dir="${build-dir}"/>
<delete>
<fileset dir="." includes="**/*.war"/>
</delete>
</target>

<!--Third Target:: compile-->

<target name="compile" depends="init">
<mkdir dir="${build-dir}"/>
<!--<copy preservelastmodified="false" todir="${build-dir}/">-->
<!--<fileset includes="*.*" dir="${runtime-libs}"/>-->
<!--</copy>-->
<javac
bootclasspath="${runtime-libs}/rt.jar"
target="1.2"
source="1.2"
includeJavaRuntime="false"
includeAntRuntime="false"
debug="yes"
destdir="${build-dir}">
<classpath refid="project.class.path"/>
<src path="${src}"/>
</javac>
</target>
</project>

Any idea or help please,

Thanks in Advance!
Sirish
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

1) That class was introduced in Java 1.4, yet your Ant task is set to compile using Java 1.2.
2) Did you increase the memory when calling Ant?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sirish Kumar Gongal Reddy
Ranch Hand

Joined: Oct 25, 2004
Posts: 109
Jeanne,

You are right I have not updated my rt.jar file in my runtime-lib dir. but my Intellij using 1.4 as project JDK. I'll update the .jar file.

If come to the Virtual memory size Yes I am setting VM size = 512 in <javac> target it self. no I resloved VM memory issue.

Jeanne,
I have posted one issues that I need to start and stop WebSphere through <exec> but I am facing some problmes do you have any snippet for this. I'll help me a lot.

Many Thanks!


Best Regards,
Sirish
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Originally posted by Sirish Kumar GongalReddy:
If come to the Virtual memory size Yes I am setting VM size = 512 in <javac> target it self. no I resloved VM memory issue.

Right. My suspicion is that it is Ant itself that is running out of memory, not javac. When you call the Ant command itself, you can pass arguments to set more memory.

Originally posted by Sirish Kumar GongalReddy:
I have posted one issues that I need to start and stop WebSphere through <exec> but I am facing some problmes do you have any snippet for this. I'll help me a lot.

See my reply in that thread. Keeping one issue in one thread helps people follow it when they have that problem in the future.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ANT Complilation Issue
 
Similar Threads
ant tomcat dist -wrong file structure specified
How to specify jdk version in build.xml
Ant+JUnit
Can't get the code coverage output using Cobertura + Testng + Ant
compilation errors using ant