You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2019/05/22 07:21:39 UTC

[Bug 63457] New: Error using ant-1.10.6 with jdk8

https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

            Bug ID: 63457
           Summary: Error using ant-1.10.6 with jdk8
           Product: Ant
           Version: 1.10.6
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
          Assignee: notifications@ant.apache.org
          Reporter: dperez@divisait.com
  Target Milestone: ---

Although ant-1.10.6.jar is compiled with jdk8 compatibility is not possible to
run it with a jdk 8 Runtime.

If you run with a jdk8 runtime you would get the following error:

Caused by: java.lang.NoSuchMethodError:
java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
                at
org.apache.tools.zip.Simple8BitZipEncoding.encode(Simple8BitZipEncoding.java:250)
                at
org.apache.tools.zip.ZipOutputStream.getName(ZipOutputStream.java:1646)
                at
org.apache.tools.zip.ZipOutputStream.writeLocalFileHeader(ZipOutputStream.java:1059)
                at
org.apache.tools.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:769)


Run with jdk11 runtime works without problem. Seems like a linking problem for
me.

Version 1.10.5 works perfect using both jdk8 and jdk11 runtimes.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Jaikiran Pai <ja...@apache.org> ---
That doesn't look good. Is there a build file that you can attach to help
reproduce this?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

J.M. (Martijn) Kruithof <jk...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.10.7
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from J.M. (Martijn) Kruithof <jk...@apache.org> ---
Reproduced by building on jdk11 and running the ant testset using jdk8.
Should be fixed by:
https://github.com/apache/ant/commit/823a5316eb69f49d72838c24ded4478ecf29b970

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

--- Comment #3 from David Pérez Serrada <dp...@divisait.com> ---
Is important the setEncoding part:

                // Fails if set this encoding 
                zout.setEncoding("ISO-8859-1");
                // With this encoding works perfect
                // zout.setEncoding("UTF-8");

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

David Pérez Serrada <dp...@divisait.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dperez@divisait.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

--- Comment #2 from David Pérez Serrada <dp...@divisait.com> ---
Created attachment 36594
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36594&action=edit
Sample Source Code

Simple and ugly code showing the problem.

--------------------------------------------------------------------------------
dperez@pc-dperezs /cygdrive/d/temp
$ /cygdrive/d/java/jdks/jdk1.8.0_171/bin/javac -cp ant-1.10.6.jar ZipTest.java

dperez@pc-dperezs /cygdrive/d/temp
$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

dperez@pc-dperezs /cygdrive/d/temp
$ java -cp "ant-1.10.6.jar;." ZipTest
Begin
Exception in thread "main" java.lang.NoSuchMethodError:
java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;
        at org.apache.tools.zip.NioZipEncoding.encode(NioZipEncoding.java:105)
        at
org.apache.tools.zip.ZipOutputStream.getName(ZipOutputStream.java:1646)
        at
org.apache.tools.zip.ZipOutputStream.writeLocalFileHeader(ZipOutputStream.java:1059)
        at
org.apache.tools.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:769)
        at ZipTest.main(ZipTest.java:18)

dperez@pc-dperezs /cygdrive/d/temp
$ java -cp "ant-1.10.5.jar;." ZipTest
Begin
End

dperez@pc-dperezs /cygdrive/d/temp
$ java -cp "ant-1.10.6.jar;." ZipTest^C

dperez@pc-dperezs /cygdrive/d/temp
$ . setjava11.sh

dperez@pc-dperezs /cygdrive/d/temp
$ java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

dperez@pc-dperezs /cygdrive/d/temp
$ java -cp "ant-1.10.6.jar;." ZipTest
Begin
End
--------------------------------------------------------------------------------

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

--- Comment #4 from Jaikiran Pai <ja...@apache.org> ---
Thanks for those details. I can confirm, based on what I see in the generated
class files for the Ant library, that there's a difference in what bytecode is
generated for this class (even with -target set to 1.8). I have to understand a
bit about the --release option in javac to see if we (or rather me) missed
adding that option to our build process when releasing this 1.10.6 version.

I'll take a more detailed look at this tonight.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

David Pérez Serrada <dp...@divisait.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63457] Error using ant-1.10.6 with jdk8

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63457

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |blocker
           Priority|P2                          |P1

--- Comment #5 from Jaikiran Pai <ja...@apache.org> ---
I've had a look at this one in more detail and I understand where we went wrong
with our build and release process, that introduced this issue. I am in the
process of fixing this and this obviously will need a new release. I'll be
sending out the details to the dev list once I have a potential fix.

-- 
You are receiving this mail because:
You are the assignee for the bug.