diff --git a/bindings/java/build.xml b/bindings/java/build.xml
index c0e9de9ed67785691cbb53dd208aaa20a679facd..7b978148f7e73bbac6cc7e0b98d0d5ea117be925 100755
--- a/bindings/java/build.xml
+++ b/bindings/java/build.xml
@@ -10,6 +10,7 @@
 	</condition>
 	<import file="build-${os.family}.xml"/>
 
+    <!-- Careful changing this because release-windows.pl updates it by pattern -->
 	<property name="VERSION" value="4.6.1"/>
 
 	<!-- set global properties for this build -->
diff --git a/release/release-unix.pl b/release/release-unix.pl
index 942f8ea8624aaeb3cc8bc30bf435e72bbdfa55f9..249eb50e7fd47ac0668aa2a333eb42a140d5cb81 100755
--- a/release/release-unix.pl
+++ b/release/release-unix.pl
@@ -381,6 +381,40 @@ sub update_libver {
     rename ($OFILE, $IFILE) or die "Error renaming $OFILE";
 }
 
+# update the version in the Java ant build.xml file
+sub update_buildxml {
+
+    print "Updating the version in Java build.xml file\n";
+    
+    my $IFILE = "bindings/java/build.xml";
+    my $OFILE = "bindings/java/build.xml2";
+
+    open (CONF_IN, "<${IFILE}") or 
+        die "Cannot open $IFILE";
+    open (CONF_OUT, ">${OFILE}") or 
+        die "Cannot open $OFILE";
+
+    my $found = 0;
+    while (<CONF_IN>) {
+        if (/name=\"VERSION\"/) {
+            print CONF_OUT "<property name=\"VERSION\" value=\"${VER}\"/>\n";
+            $found++;
+        }
+        else {
+            print CONF_OUT $_;
+        }
+    }
+    close (CONF_IN);
+    close (CONF_OUT);
+
+    if ($found != 1) {
+        die "Error: Found $found (instead of 1) occurrences of Version: in Java Build file";
+    }
+
+    unlink ($IFILE) or die "Error deleting $IFILE";
+    rename ($OFILE, $IFILE) or die "Error renaming $OFILE";
+}
+
 
 # Update the autotools / autobuild files in current source directory
 sub bootstrap() {
@@ -576,6 +610,7 @@ ()
 update_hver();
 update_libver();
 update_pkgver();
+update_buildxml();
 
 bootstrap();
 checkin_vers();