PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.54k stars 2.22k forks source link

Java 22 breaks typing in console on windows. #10405

Open andrewkm opened 3 months ago

andrewkm commented 3 months ago

Expected behavior

Smooth console input via Windows Server 2022 cmd.exe without glitches.

Observed/Actual behavior

Glitchy buggy console input. Freezing, etc.

Steps/models to reproduce

Java 22; typing in consoles is broken on windows with paper, works on Java 21. Java 22; typing in consoles works fine on windows with bungeecord/waterfall.

Testing on fresh Paper install with no plugins for sanity, same result, borked on 22 good on 21. Basically it's all glitched, freezes, random keys don't register, etc.

Plugin and Datapack List

Unrelated, tested on fresh install.

Paper version

This server is running Paper version git-Paper-478 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 5436d44)

Other

No response

electronicboy commented 3 months ago

I don't have x86 hardware worth firing up for this, so, span up the windows VM I have sitting around on this arm laptop;

1) Terminal input inside of windows terminal generally seems kinda janky, using conhost provides a much better experience in general 2) counter to 1, it seemed to have gotten stuck less, but, it still ends up getting locked up, it's almost as if the terminal stuff is just not reading the input for some reason, if you keep spamming it eventually seems to pick back up again.

I don't have the desire/will to dig much deeper into this with the lack of a real setup here especially as it's working fine for the environments I can support

andrewkm commented 3 months ago

Just an update, this bug persists on JAVA 22.0.1.

Malfrador commented 3 months ago

This seems to be a Powershell 5 specific issue. The console is working fine with the good old cmd.exe, and it also works without any issues with Powershell 7.

Seems to be caused by this JDK change. As a workaround, starting the server with -Djdk.console=java.base to revert to the old JDK behaviour fixes the issue. I would recommend just using PS7 though, its much nicer anyways.

electronicboy commented 3 months ago

I thought that I got somebody to create an issue report but I'm blind, that is likely related to the crash that people get when double clicking on the server jar in order to run it

andrewkm commented 3 months ago

The -Djdk.console=java.base workaround does work on JAVA 22.0.1. Thanks for that!

MinecraftMan1013number2 commented 2 weeks ago

I am also having this issue and I have found that the issue does NOT happen with version paper-1.20-17, but DOES happen in version paper-1.20.1-196, all with Java 22. I can try and find the exact paper version where the issue starts, but It'll take some time.

EDIT:

As a workaround, starting the server with -Djdk.console=java.base to revert to the old JDK behaviour fixes the issue.

This also worked for me, thank you!

jgibbz328 commented 5 days ago

I have updated to Powershell 7, but still having the same issue. I am a newb and not sure where to put the -Djdk.console=java.base (i tried putting it in the start.bat file but that didn't work)

andrewkm commented 5 days ago

This seems to be a Powershell 5 specific issue. The console is working fine with the good old cmd.exe, and it also works without any issues with Powershell 7.

Seems to be caused by this JDK change. As a workaround, starting the server with -Djdk.console=java.base to revert to the old JDK behaviour fixes the issue. I would recommend just using PS7 though, its much nicer anyways.

For the record I'm not using powershell. I am in fact using good old cmd.exe

andrewkm commented 4 days ago

As an update, this is still broken via:

Paper 1.21 Build 101 Windows Server 2022 cmd.exe Java 22.0.2