jai-imageio / jai-imageio-core

JAI ImageIO Core (without javax.media.jai dependencies)
Other
234 stars 87 forks source link

JDK9 compatibility: java.lang.NumberFormatException #45

Closed rototor closed 7 years ago

rototor commented 7 years ago

JDK 9 has changed how the Java Versions are formated. You need to parse them in an other way.

ImageUtil.processOnRegistration() is throwing a NumberFormatException, because System.getProperty("java.specification.version") returns "9" and not "1.9".

Please change

    jvmVersionString = jvmVersionString.substring(verIndex+2);

to

        if( verIndex != -1 )
        jvmVersionString = jvmVersionString.substring(verIndex+2);

This should fix the problem. If I understand the future Oracle plans for Java correctly the next version might be 9.1, so you may want to fix this code in a more general way.

rototor commented 7 years ago

Sorry, just saw that this is a duplicate of #24