Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work on Java 8 #88

Closed
Frosty-J opened this issue Mar 3, 2024 · 4 comments
Closed

Does not work on Java 8 #88

Frosty-J opened this issue Mar 3, 2024 · 4 comments

Comments

@Frosty-J
Copy link
Contributor

Frosty-J commented Mar 3, 2024

I think there was a change to ByteBuffer sometime after 8, with or before 11. My game just repeatedly spews the below if I run it on a Java 8 JRE. Was under the impression gdx-video should be good for down to 7. I'll do some troubleshooting now, will probably just use a new JRE - jam time is running out!

Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()Ljava/nio/ByteBuffer;
        at com.badlogic.gdx.video.CommonVideoPlayerDesktop.readFileContents(CommonVideoPlayerDesktop.java:145)
        at com.badlogic.gdx.video.CommonVideoPlayerDesktop.access$000(CommonVideoPlayerDesktop.java:40)
        at com.badlogic.gdx.video.CommonVideoPlayerDesktop$1.fillBuffer(CommonVideoPlayerDesktop.java:106)
        at com.badlogic.gdx.video.VideoDecoder.loadStream(Native Method)
        at com.badlogic.gdx.video.CommonVideoPlayerDesktop.play(CommonVideoPlayerDesktop.java:103)
        at com.javacakegames.gbtksort.actors.VideosActor.<init>(VideosActor.java:32)
        at com.javacakegames.gbtksort.screens.GameScreen.show(GameScreen.java:406)
        at de.eskalon.commons.screen.ScreenManager.initializeScreen(ScreenManager.java:333)
        at de.eskalon.commons.screen.ScreenManager.render(ScreenManager.java:285)
        at com.javacakegames.gbtksort.GbtkGame.render(GbtkGame.java:84)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window.update(Lwjgl3Window.java:387)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:193)
        at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:167)
        at com.javacakegames.gbtksort.Lwjgl3Launcher.main(Lwjgl3Launcher.java:272)

(line numbers might be wrong since this is my own build of it)

@SimonIT
Copy link
Member

SimonIT commented Mar 3, 2024

I found the reason:
https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip
We have to find now where to use Buffer instead of ByteBuffer
I remember we already had that error before: libgdx/libgdx#6331

@mgsx-dev
Copy link
Contributor

mgsx-dev commented Mar 3, 2024

best is to use the release option like it's done in libgdx https://github.com/libgdx/libgdx/blob/master/gdx/build.gradle#L19
instead of doing the same mistake we alredy discussed : libgdx/libgdx#6331

@Frosty-J
Copy link
Contributor Author

Frosty-J commented Mar 4, 2024

I agree. I didn't have much luck when I tried the cast... not sure why, actually.

options.release works well. I don't think we have a versions.java in gdx-video, so I hardcoded it when testing.

@SimonIT
Copy link
Member

SimonIT commented Nov 1, 2024

Added in daafede

@SimonIT SimonIT closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants