diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 29f628ca38a88a60062668368b805bdda6559acc..7f841f090bb524ea5c8e60875770361183b443fa 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -184,6 +184,7 @@ (define-public icedtea6
                (zero? (system* "tar" "xvjf"
                                (assoc-ref inputs "ant-bootstrap")))
                (begin
+                 (patch-shebang "apache-ant-1.9.4/bin/ant")
                  (chdir (string-append ,name "-" ,version))
                  (mkdir "openjdk")
                  (with-directory-excursion "openjdk"
@@ -193,8 +194,6 @@ (define-public icedtea6
         (alist-cons-after
          'unpack 'patch-paths
          (lambda _
-           (patch-shebang "../apache-ant-1.9.4/bin/ant")
-
            ;; shebang in patches so that they apply cleanly
            (substitute* '("patches/jtreg-jrunscript.patch"
                           "patches/hotspot/hs23/drop_unlicensed_test.patch")