diff --git a/configure b/configure
index 284d231db93649eba85ae21d3e90280351fd5a1c..992e289fbef5842bbbfccf152baa75f2a5e0e85d 100755
--- a/configure
+++ b/configure
@@ -3252,7 +3252,7 @@ echo "$as_me: error: Ant is required to build Java components
 If you have Ant already installed, see config.log for details on the failure." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if "$ANT" -version | sed q | egrep -v ' 1\.[5-9]| [2-9]\.' >/dev/null ; then
+if "$ANT" -version | egrep -i 'ant version' | sed q | egrep -v ' 1\.[5-9]| [2-9]\.' >/dev/null ; then
   { { echo "$as_me:$LINENO: error: Ant version >= 1.5 is required to build Java components" >&5
 echo "$as_me: error: Ant version >= 1.5 is required to build Java components" >&2;}
    { (exit 1); exit 1; }; }
diff --git a/configure.in b/configure.in
index 67c23b638f9b5d7e37448165c993565f95be45e4..46ee9d05c0e9fa5ae2476ee2c53f07b7c6d52aa9 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.298 2003/10/25 15:32:11 petere Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.299 2003/10/28 20:26:45 tgl Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -409,7 +409,7 @@ if test -z "$ANT"; then
   AC_MSG_ERROR([Ant is required to build Java components
 If you have Ant already installed, see config.log for details on the failure.])
 fi
-if "$ANT" -version | sed q | egrep -v ' 1\.[[5-9]]| [[2-9]]\.' >/dev/null ; then
+if "$ANT" -version | egrep -i 'ant version' | sed q | egrep -v ' 1\.[[5-9]]| [[2-9]]\.' >/dev/null ; then
   AC_MSG_ERROR([Ant version >= 1.5 is required to build Java components])
 fi],
 [AC_MSG_RESULT(no)])