MinicraftPlus / minicraft-plus-revived

Minicraft+, an extension of Notch's original minicraft project, with tons more features.
GNU General Public License v3.0
477 stars 96 forks source link

Canvas initialization error on Java 20 (Linux) #540

Closed parkerlreed closed 1 year ago

parkerlreed commented 1 year ago

Describe the bug Crashes on launch

(deck@steamdeck Downloads)$ java -jar minicraft_plus-2.2.0-dev3.jar 
[Crash Handler] ERROR: java.awt.AWTException: Only double or single buffering is supported
        at java.desktop/sun.awt.X11GraphicsConfig.createBackBuffer(X11GraphicsConfig.java:432)
        at java.desktop/sun.awt.X11.XComponentPeer.createBuffers(XComponentPeer.java:1115)
        at java.desktop/java.awt.Component$FlipBufferStrategy.createBuffers(Component.java:4116)
        at java.desktop/java.awt.Component$FlipBufferStrategy.<init>(Component.java:4058)
        at java.desktop/java.awt.Component$FlipSubRegionBufferStrategy.<init>(Component.java:4592)
        at java.desktop/java.awt.Component.createBufferStrategy(Component.java:3921)
        at java.desktop/java.awt.Canvas.createBufferStrategy(Canvas.java:201)
        at minicraft.core.Renderer.initScreen(Renderer.java:114)
        at minicraft.core.Game.main(Game.java:80)
[Crash Handler] ERROR: Crash: Unexpected error: Canvas Initialization Failure: The canvas is unable to be initialized.
(130)(deck@steamdeck Downloads)$ java --version
openjdk 20.0.1 2023-04-18
OpenJDK Runtime Environment (build 20.0.1+9)
OpenJDK 64-Bit Server VM (build 20.0.1+9, mixed mode, sharing)

To Reproduce Steps to reproduce the behavior:

  1. Run with java -jar minicraft_plus-2.2.0-dev3.jar

Expected behavior Game running

Screenshots image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

parkerlreed commented 1 year ago

Looks like this was already fixed but there hasn't been a new release?

https://github.com/MinicraftPlus/minicraft-plus-revived/pull/474

parkerlreed commented 1 year ago

Tried building it manually but get an unsupported class file major version 64 error

(1)(deck@steamdeck minicraft-plus-revived)$ ./gradlew build

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file '/home/deck/build/minicraft-plus-revived/settings.gradle' (/home/deck/.gradle/caches/7.3/scripts/d8w0j42yss9vvupod6hmx695x).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 751ms
parkerlreed commented 1 year ago

Builds successfully and works with system gradle. GitHub releases needs a new dev build

(deck@steamdeck minicraft-plus-revived)$ gradle build

Welcome to Gradle 8.1.1!

Here are the highlights of this release:
 - Stable configuration cache
 - Experimental Kotlin DSL assignment syntax
 - Building with Java 20

For more details see https://docs.gradle.org/8.1.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :common:compileJava
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

> Task :client:compileJava
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 warnings

> Task :server:compileJava
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

BUILD SUCCESSFUL in 19s
11 actionable tasks: 11 executed

image

Litorom commented 1 year ago

We have nightly builds with the latest fixes and sometimes unstable features. Idk what happened to it however.

Makkkkus commented 1 year ago

https://github.com/MinicraftPlus/minicraft-plus-revived/actions/runs/5604020457

Fixed!

Makkkkus commented 1 year ago

duplicate of #465