Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ANT Complilation Issue

 
Sirish Kumar Gongal Reddy
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sirish Kumar Gongal Reddy
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34671
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic