GlowstoneMC / Glowstone

A fast, customizable and compatible open source server for Minecraft: Java Edition
https://glowstone.net
Other
1.9k stars 273 forks source link

Incompatibility with Java 8, when using CircleCI build #866

Closed aramperes closed 6 years ago

aramperes commented 6 years ago

Using Java 8 update 111. I downloaded build bd275e2 from CircleCI, where builds use Java 9.

I get this exception:

com.google.common.util.concurrent.ExecutionError: java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2215)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4154)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153)
        at net.glowstone.io.anvil.RegionFileCache.getRegionFile(RegionFileCache.java:89)
        at net.glowstone.io.anvil.AnvilChunkIoService.read(AnvilChunkIoService.java:55)
        at net.glowstone.chunk.ChunkManager.loadChunk(ChunkManager.java:151)
        at net.glowstone.chunk.GlowChunk.load(GlowChunk.java:210)
        at net.glowstone.chunk.GlowChunk.load(GlowChunk.java:205)
        at net.glowstone.chunk.GlowChunk.getHeight(GlowChunk.java:639)
        at net.glowstone.GlowWorld.getHighestBlockYAt(GlowWorld.java:1185)
        at net.glowstone.GlowWorld.getHighestBlockAt(GlowWorld.java:1190)
        at net.glowstone.generator.GlowChunkGenerator.canSpawn(GlowChunkGenerator.java:68)
Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
        at net.glowstone.io.anvil.RegionFile.<init>(RegionFile.java:184)
        at net.glowstone.io.anvil.RegionFileCache$1.load(RegionFileCache.java:65)
        at net.glowstone.io.anvil.RegionFileCache$1.load(RegionFileCache.java:62)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211)
        ... 20 more

It appears that building using Java 9 does cause issues when running on Java 8, even if the pom files specifies bytecode version for 1.8. java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer was introduced in 1.9, from what I understand.

Probably since 1885359b8a62b2630e56982c60106b916a5d8cdf

Workaround: Build locally using Java 8 instead, or use Java 9.

Pr0methean commented 6 years ago

Since we were getting OOM kills even on JDK9, I've decided to try a different fix for the OOM kills: #868 Should we have a second CI build for JDK9? (I don't think any of Circle's machine images have JDK9, so we might have to run the JDK9 build flakily on Docker until self-hosting could be arranged.)