jankotek / mapdb

MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.
https://mapdb.org
Apache License 2.0
4.87k stars 873 forks source link

mapdb-3.0.9.jar in Central Repository cannot be used in jdk1.8 #1014

Closed xiaqisi closed 10 months ago

xiaqisi commented 1 year ago

Hi, i get mapdb-3.0.9.jar from https://repo1.maven.org/maven2/org/mapdb/mapdb/3.0.9/ and run in jdk1.8, but get exception:

java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer;
        at org.mapdb.volume.FileChannelVol.clear(FileChannelVol.java:354) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.volume.FileChannelVol.clear(FileChannelVol.java:346) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.StoreDirect.longStackNewChunk(StoreDirect.kt:371) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.StoreDirect.longStackPut(StoreDirect.kt:289) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.StoreDirectAbstract.releaseData(StoreDirectAbstract.kt:369) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.StoreDirect.updateProtected(StoreDirect.kt:664) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.StoreDirect.update(StoreDirect.kt:635) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.IndexTreeListJava.treePut(IndexTreeListJava.java:341) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.IndexTreeLongLongMap.put(IndexTreeLongLongMap.kt:77) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.HTreeMap.putprotected(HTreeMap.kt:363) ~[mapdb-3.0.9.jar:?]
        at org.mapdb.HTreeMap.put(HTreeMap.kt:324) ~[mapdb-3.0.9.jar:?]        

Then I found that mapdb-3.0.9.jar was compiled in jdk11:

Manifest-Version: 1.0
Bnd-LastModified: 1669302728545
Build-Jdk: 11.0.16
Built-By: jan
Bundle-Description: MapDB provides concurrent Maps, Sets and Queues back
 ed by disk storage or off-heap memory. It is a fast, scalable and easy 
 to use embedded Java database.
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-ManifestVersion: 2
Bundle-Name: mapdb
Bundle-SymbolicName: org.mapdb.mapdb
Bundle-Version: 3.0.9

Is it possible to provide jdk1.8 compiled version in Central Repository?

jankotek commented 1 year ago

Sorry, mistake is on my side. I am not going to fix it. 3.0.9 has one change that adds configuration option. There are no bugfixes. Use 3.0.8

wjw465150 commented 1 year ago

how to configuration option?

slovdahl commented 10 months ago

Version 3.0.8 is problematic too, see #1024.

LeboyX commented 10 months ago

Using 3.0.8 isn't possible, either, b/c the downstream Eclipse Collection dependency is unbounded. The latest version of Eclipse Collections is also not compatible w/ Java 8.

zoyanhui commented 10 months ago

So, what's the latest version can be used in Java 8?

jankotek commented 10 months ago

There is new release 3.0.10 compiled with JDK8. Use that one.