lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.1k stars 253 forks source link

Java 9 compatibility #122

Closed obowden closed 5 years ago

obowden commented 6 years ago

Hi,

I've just run the dependency checking tool jdeps on the lz4-java-1.4.1.jar file and it's flagged a usage of the sun.misc.Unsafe package that is not supported in Java 9:

digraph "lz4-java-1.4.1.jar" { "net.jpountz.util.UnsafeUtils" -> "sun.misc.Unsafe (JDK internal API (rt.jar))"; }

Has this been tested against Java 9, or are there plans to release a Java 9 compatible version?

Thanks

mkozioro commented 6 years ago

Hi @obowden. If I remember good, LZ4 can use different kinds of compressors and decompressors. One safe, one using unsafe and one using JNI bindings. Maybe just try safe one. Look at LZ4Factory class for different types of compressors - fastestJavaInstance(), fastestInstance(), safeInstance(), unsafeInstance() etc.

obowden commented 6 years ago

Thanks for getting back to me. I'll check that out.

odaira commented 5 years ago

lz4-java runs with Java 9 or later at least for the moment. OpenJDK still supports sun.misc.Unsafe. I will work on it once OpenJDK stops supporting sun.misc.Unsafe. Let me know if you find any other JVM that dropped sun.misc.Unsafe.

Building lz4-java with Java 9 caused some errors, so I have updated build.xml and ivy.xml to fix them.