Closed VadamDev closed 7 months ago
Try using a newer version of Java
Hello. It works on Java 17. But what if i wanna keep using Java 8 ? :x This errors occurs when the build bytecode is in Java9+ since they changed the ByteBuffer class (see: https://www.morling.dev/blog/bytebuffer-and-the-dreaded-nosuchmethoderror/)
But the source compatiblity in the Lavaplayer build.gradle file is Java 8 (line 36) so i guess just adding targetCompatibility = JavaVersion.VERSION_1_8 would fix the issue
Otherwise, it would be cool to mention what minimum version of Java you need to use this fork ^^'
But what if i wanna keep using Java 8 ? :x
Unless you have a specific requirement that forces you to use Java 8 I would really advise you upgrade. Aside from legacy software there's no real reason to continue using such an outdated version
It's not a issue for this project, I can update but I have other legacy bots that I will need to update which will take time :x Would be cool to have a fix honestly
Could you give 08fe37dad9c0a2bb42240dab5401726cada0cc95 a try and see if it fixes your issue?
Still get the same error (Same bot, JVM version etc...)
Gradle file juste in case:
dependencies {
implementation 'com.github.lavalink-devs:lavaplayer:set-target-compatibility-SNAPSHOT'
}
tasks.withType(Tar).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(Zip).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
34f8ca076291ba4c0a1c98f50da91520874f33cc?
Same issue
Out of curiosity, I tried your fork (https://github.com/devoxin/lavaplayer) and it works with Java 8
I'd just stick with my fork then tbh. There's speculation as to whether we leverage Java language features from versions after 8, or it could equally be due to a fault in how Gradle is being configured to compile the project, but extensive testing isn't worth it as I think the general consensus is that we don't want to retain support for super old Java versions so are ultimately looking at bumping the minimum version required to 11.
Just keep in mind with my fork, that it's missing a lot of the custom stuff like audio track isrcs and artwork URLs. If you don't need that then it should be no issue.
I'm going to go ahead and close this issue as I don't think there's much more to be said. If there is, you're free to join the Lavalink Discord server
Versions
Description
Hello, When trying to play any track, I keep getting NSM on ByteBuffer (see stacktrace) even after mentionning in my gradle file that the source/target compatibility is Java 8
Stacktrace
[LocalAudioTrackExecutor/ERROR]: Error in playback of mLxI-q9Fi0s com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track. at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:45) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:113) at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$2(DefaultAudioPlayerManager.java:330) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer; at com.sedmelluq.discord.lavaplayer.container.matroska.format.MutableMatroskaBlock.getNextFrameBuffer(MutableMatroskaBlock.java:56) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.processFrameInBlock(MatroskaStreamingFile.java:368) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseClusterSimpleBlock(MatroskaStreamingFile.java:332) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.parseNextCluster(MatroskaStreamingFile.java:317) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile.provideFrames(MatroskaStreamingFile.java:293) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.lambda$process$0(MatroskaAudioTrack.java:40) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:284) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.executeProcessingLoop(LocalAudioTrackExecutor.java:257) at com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaAudioTrack.process(MatroskaAudioTrack.java:39) at com.sedmelluq.discord.lavaplayer.track.DelegatedAudioTrack.processDelegate(DelegatedAudioTrack.java:25) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.processStatic(YoutubeAudioTrack.java:64) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:51) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:101)
build.gradle