javafxports / javafxmobile-plugin

A gradle plugin for building mobile applications in java.
BSD 3-Clause "New" or "Revised" License
42 stars 19 forks source link

java.nio.Buffer incompatibilities between java 8 and java 9 #13

Closed tiainen closed 6 years ago

tiainen commented 6 years ago

The implementations of the java.nio.Buffer classes are incompatible between java 8 and java 9. The following methods are now overridden in each implementing class and override the return type with the implementing class type instead of java.nio.Buffer.

The implementing classes are: java.nio.ByteBuffer, java.nio.CharBuffer, java.nio.DoubleBuffer, java.nio.FloatBuffer, java.nio.IntBuffer, java.nio.LongBuffer, java.nio.ShortBuffer and java.nio.MappedByteBuffer.

This causes issues when compiling classes with java 9 while setting java 8 as the compile target. Running the compiled classes in a java 8 runtime will throw the following exception:

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;