thecoder-001 / MineColab

Run Minecraft Server on Google Colab.
GNU General Public License v3.0
272 stars 80 forks source link

[BUG] Minecolab doesn't work for 1.17 server #35

Closed Shadow0Bit closed 3 years ago

Shadow0Bit commented 3 years ago

My notepad outputs an error: java.lang.UnsupportedClassVersionError: net/minecraft/server/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 59.0

How to reproduce the behavior: Try to run 1.17 Vanilla server files

It's propably because Java must be updated to newer version. Anyone got idea how to do that?

S-N00B-1 commented 3 years ago

Minecraft servers now use Java 16, you might want to change the variable that dictates what java version to download.

Shadow0Bit commented 3 years ago

Minecraft servers now use Java 16, you might want to change the variable that dictates what java version to download.

Thanks for reply, but if you read bug description, you'll notice I said I know it's because of older Java but I don't know how to update it/change version

Shadow0Bit commented 3 years ago

Ok so I managed to change Java Version by editing this line: !sudo apt-get install adoptopenjdk-15-hotspot-jre &>/dev/null To this: !sudo apt-get install adoptopenjdk-16-hotspot-jre &>/dev/null

(you can also comment everything under # Install OpenJDK 15 and write this two lines: sudo add-apt-repository ppa:linuxuprising/java sudo apt install openjdk-16-jdk )

But I still get the following error: Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException... Link to full error message.

I've tried to run my server file on local pc and it worked just fine.

genvara commented 3 years ago

Yeah for now you can't use MIneColab to make a 1.17 server, since Java 16 only supports Ubuntu 20.04 and 20.10, and Google Colab's machines run on 18.04.

I also have the same problem.

thecoder-001 commented 3 years ago

Would look into it in a few hours. It should be pretty easy to switch since we're already using a ppa to get the jdk.

genvara commented 3 years ago

Would look into it in a few hours. It should be pretty easy to switch since we're already using a ppa to get the jdk.

Here's the thing i tried manually installing the Java 16 JDK and i made sure that it was running it, when launching the JAR It would not launch and spits out errors, unless you are adding a patched jdk into the ppa then idk

iamtakingithard commented 3 years ago

Hello, people added PR which resolves this issue https://github.com/thecoder-001/MineColab/pull/36

Shadow0Bit commented 3 years ago

Hello, people added PR which resolves this issue #36

Sorry but your solution isn't realy working !sudo apt-get install adoptopenjdk-16-hotspot-openj9 &>/dev/null && echo "Yay! Openjdk16 has been successfully installed." || echo "Failed to install OpenJdk16." outputs: "Failed to install OpenJdk16"

Shadow0Bit commented 3 years ago

Ok, now it works now, thanks to @AndreVuillemot160

Quick fix: Just change the line: !sudo apt-get install adoptopenjdk-15-hotspot-jre &>/dev/null To: !sudo apt-get install adoptopenjdk-16-openj9 &>/dev/null

(In AndreVuillemort160 commit there is adoptopenjdk-16-hotspot-openj9 instead of adoptopenjdk-16-openj9 but I'm sure it's just a typo)

Thanks everyone for help!

Love, Shadow0Bit.