thecoder-001 / MineColab

Run Minecraft Server on Google Colab.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Use Java 8 for minecraft 1.12.2 and lower

Cs0ki opened this issue · comments

commented

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:
Using a 1.12.2 forge
Expected behavior
split up error code
with mods and without mod is same results
image

Hello!
This issue is popping up is due to using java version 15 by default which works fine for newer versions of Minecraft but causes problems in older versions. Plan of including a config to change this easily is expected soon (though is unfortunately getting regularly delayed because of my lack of time), but for now you can edit the following line and change 15 to 8 to fix the issue. Ignore any warnings that say that you are using java 8 instead of 15. It should function correctly.

Screen Shot 2021-01-01 at 4 50 44 PM

PS: factory reset the runtime if any problems persist. Don't worry, this won't delete any world data.
Screen Shot 2021-01-01 at 4 54 48 PM

commented

still the same
yeah

Remove everything after # Update the package lists to the line before # Mount drive and replace with

# Update the package lists
!sudo apt update &>/dev/null && echo "apt cache successfully updated" || echo "apt cache update failed, you might receive stale packages"
# Install OpenJDK 8
!sudo apt-get install openjdk-8-jdk &>/dev/null && echo "Yay! Openjdk8 has been successfully installed." || echo "Failed to install OpenJdk8."

#Perform java version check
java_ver = !java -version 2>&1 | awk -F[\"\.] -v OFS=. 'NR==1{print $2}'

!sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
!export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
!export PATH=$PATH:$JAVA_HOME
print(java_ver)

And it should work.

@infinitygamer404 's solution should work. Minecraft 1.12 is incompatible with java 15

@Cs0ki there ya go