New release for Java 25?
We are currently depending on 8.0.0 version of datasketches-java, and that means we are stuck with Java 21 and no other version. As stated in the README of this repo, FFM API is finalized and now we have Java 25 FCS that has the finalized FFM API and is an LTS version.
Guessing from the README, datasketches-java seems already ready for the finalized FFM API, so could you release another version of datasketches-java requiring Java 22 or later?
A release plan would be appreciated.
25 just came out and not all the tools have been updated to support it yet. So some of this will depend on how quickly supporting tools adopt it.
Yes, the major remaining issues are the supporting tools not just the JVM release. For example, the adoptium.net/temurin Java 25 was just released yesterday, September 25, and this is required for the GHA workflows to do CI testing. Then the GHA tools themselves will have to support Java 25. I don't know if they are ready yet. Checkstyle, is still not compatible with Java 25 and it looks like from their website it might be a number of months before it will support Java 25. I will probably have to release DataSketches-java 9.0.0 without checkstyle support, which is unfortunate. Nonetheless, I am working diligently on the 9.0.0 release and hope to have it out soon (I am the only individual working on it!).
Please note that we have a very. very tiny group of volunteers that actively support the DataSketches library, and we would appreciate any help we can get -- example, help with code reviews, when a PR is opened for review!
Thank you for elaborating on why a new release requires more time. As far as I know, the FFM API final has subtle differences with the Java 21 preview API, and it seems you are working on making the current codebase compatible with the final API.
If there is anything I can help, please let me know. Though I'm not so familiar with the internals of datasketches, I'm leveraging it in my work project and have a bit of experience with the FFM API (though abandoned after evaluation. :) ).
FFM is a godsend for any application that needs to work off-heap and quite powerful. It pretty much eliminates the need for JNI and ByteBuffer.
I’m curious why you abandoned it?
@leerho a bit off topic, but here is why. I wanted to have more control over the memory layout of the data structures I needed. So evaluated FFM as a means to implement C struct-likes. So for my case, the off-heap memory was not a critical requirement.
Different from Unsafe, it was really difficult to get rid of the bound check overhead completely with the FFM. In the end, I've ended up with generating flattened class at the compile time and leveraged Kotlin's value class to wrap around the flattened class instances to provide a more convenient API. The code generation approach was so efficient that the performance gap with FFM was quite huge, and it was proven to be fairly neat for my project after prototyping the approach.
With the FFM, it was difficult to achieve a comparable performance. Maybe I lack some important knowledge on the FFM. But my code using FFM was quite comparable in performance with that using ByteBuffer, so I think I was not completely wrong with my use of the FFM.
Interesting. I might want to try that later for critical sections, right now I have to get this rework and release done! Thanks!
Is this issue showing up on java 25 like this? I have temurin 25 LTS and I get this error with 8.0.0, while with 7.0.1 it works ok.
Caused by: java.lang.IllegalArgumentException: Could not create type
at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:170)
at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:75)
at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.mockClass(InlineBytecodeGenerator.java:223)
at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.lambda$mockClass$0(TypeCachingBytecodeGenerator.java:78)
at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:75)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMockType(InlineDelegateByteBuddyMockMaker.java:429)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.doCreateMock(InlineDelegateByteBuddyMockMaker.java:388)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMock(InlineDelegateByteBuddyMockMaker.java:367)
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.createMock(InlineByteBuddyMockMaker.java:56)
at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:99)
at org.mockito.internal.MockitoCore.mock(MockitoCore.java:84)
at org.mockito.Mockito.mock(Mockito.java:2198)
at org.mockito.Mockito.mock(Mockito.java:2113)
... 5 more
Caused by: java.lang.UnsupportedClassVersionError: org/apache/datasketches/memory/Resource (class file version 65.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 69.65535
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:962)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:144)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:776)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:691)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:620)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:578)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:2985)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2354)
at net.bytebuddy.description.method.MethodList$ForLoadedMethods.<init>(MethodList.java:151)
at net.bytebuddy.description.type.TypeDescription$ForLoadedType.getDeclaredMethods(TypeDescription.java:9027)
at net.bytebuddy.description.type.TypeDescription$Generic$OfNonGenericType.getDeclaredMethods(TypeDescription.java:3778)
at net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection.getDeclaredMethods(TypeDescription.java:6276)
at net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy$Default$5.doExtractConstructors(ConstructorStrategy.java:175)
at net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy$Default.extractConstructors(ConstructorStrategy.java:196)
at net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.applyConstructorStrategy(SubclassDynamicTypeBuilder.java:253)
at net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.toTypeWriter(SubclassDynamicTypeBuilder.java:222)
at net.bytebuddy.dynamic.scaffold.subclass.SubclassDynamicTypeBuilder.toTypeWriter(SubclassDynamicTypeBuilder.java:213)
at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase$UsingTypeWriter.make(DynamicType.java:4085)
at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase.make(DynamicType.java:3769)
at net.bytebuddy.dynamic.DynamicType$Builder$AbstractBase$Delegator.make(DynamicType.java:4021)
at org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator.mockClass(SubclassBytecodeGenerator.java:282)
at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.lambda$mockClass$0(TypeCachingBytecodeGenerator.java:78)
at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
... 24 more
❯ java -version
openjdk version "25.0.1" 2025-10-21 LTS
OpenJDK Runtime Environment Temurin-25.0.1+8 (build 25.0.1+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.1+8 (build 25.0.1+8-LTS, mixed mode, sharing)
Will there be a new version of 6.X.Y that accepts running on Java 25?
I want to use datasketches-java in a library used by a few different projects, but I don't want this library to dictate what Java version those projects must use (or if to use preview features, that's why version 7 and 8 is out of the question).
It would be awesome to have a datasketches-plain-java that doesn't use any special stuff so that any Java version could be used (i.e. even non-LTS versions).
DataSketches-java version 9.0.0-RC1 is open for voting now. It requires Java 25, but has no runtime dependencies (it is pure Java and no preview features). Assuming it passes the voting stage, it will be released soon. Why don't you try the release candidate and see if that fixes your problem.
I'm pretty sure the error you are seeing above, is due to the fact that Temurin does not support preview features more than one version back.
Since 9.0.0 has been released a few hours ago, I'll close this issue. Thank @leerho for the effort.