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

Linkage Error while loading Main Class #1613

Open
2 tasks done
orian34 opened this issue Apr 23, 2024 · 10 comments
Open
2 tasks done

Linkage Error while loading Main Class #1613

orian34 opened this issue Apr 23, 2024 · 10 comments

Comments

@orian34
Copy link

orian34 commented Apr 23, 2024

  • I searched the issue tracker for other issues covering my case
  • This is a Launcher issue. (Usually if you can reproduce it with a fresh instance)

Describe the bug
While trying to play on a 1.20.5 instance, I get an error and it refuses to launch.

To Reproduce
Steps to reproduce the behavior:

  1. Install a vanilla 1.20.5 instance.
  2. Try to launch the instance.
  3. See error

Operating System:

  • OS: [Windows 10]
  • Launcher Version: [v1.1.30]
  • Java Version: [17]
  • Minecraft Version: [1.20.5]

Additional context
I have tried to reinstall JDK 22 but it didn't change anything.
The error text:
ps stderr: Error: LinkageError occurred while loading main class net.minecraft.client.main.Main
java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

@Eskaan
Copy link
Collaborator

Eskaan commented Apr 26, 2024

Are you sure it uses the correct java binary?

@orian34
Copy link
Author

orian34 commented Apr 26, 2024

What would be the correct binary? How would I see that

@Eskaan
Copy link
Collaborator

Eskaan commented Apr 26, 2024

I would look into the java settings for that instance or at the launch command (in the console).

@orian34
Copy link
Author

orian34 commented Apr 28, 2024

I would look into the java settings for that instance or at the launch command (in the console).

I looked at it's using java 17, which I assume is the correct one?
I tried launching after deleting my custom launch arguments but it didn't change so it doesn't seem to be that either.

....\java\17.0.1+12\bin\java.exe

@Boyarnikov
Copy link

Boyarnikov commented Apr 28, 2024

Having the same issue with linkage
Creating new instance of 1.20.5 with or without fabric gets the same error. No such error accures when creating any other version (tested with 1.20.4, 1.20, 1.19)

<html>UnsupportedClassVersionError: net/minecraft/client/main/Main has been compiled by a more recent version of the Java<br>Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0</html>

<html>at java.base/java.lang.ClassLoader.defineClass1(Native Method)<br>at java.base/java.lang.ClassLoader.defineClass(Unknown Source)<br>at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)<br>at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.defineClassFwd(KnotClassLoader.java:160)<br>at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:355)<br>at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)<br>at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:119)<br>at java.base/java.lang.ClassLoader.loadClass(Unknown Source)<br>at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:463)<br>at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)<br>at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)</html>

Same Operating System env as op

@Eskaan
Copy link
Collaborator

Eskaan commented Apr 28, 2024

Hm, as to my knowledge the current msrv is Java 17. You could try with a newer version if you want.

@orian34
Copy link
Author

orian34 commented Apr 28, 2024

Mmh, I'm not sure what newer version you're talking about?
I tried checking but the existing jdk 17 installed seems to be the latest. Is it meaning a GD version?

@orian34
Copy link
Author

orian34 commented May 10, 2024

Alright, so after looking more, I had to manually change the java used by GD launcher to use the one I had installed in program files(jdk 22) and now I'm able to launch minecraft.

The problem then is that GD launcher has an automatic version which doesn't work for 1.20.5+
Probably something to look into.

@Boyarnikov
Copy link

Eather i did not correctly changed java manualy or it did not work for me. However, after reinstalling GD launcher (and updating it to a newest version) and running autoinstall for java inside client i am able to install all minecraft versions without getting the error.

For anyone who is having this issue i suggest to check if your current version of the laucher up to data.

@OttCS
Copy link
Contributor

OttCS commented Jun 18, 2024

For anyone who is having this issue i suggest to check if your current version of the laucher up to data.

https://github.com/gorilla-devs/GDLauncher-Carbon is the up to date version of the launcher. The Gorilla Devs announced here that the Carbon version of GDLauncher will be maintained, and the legacy launcher (this repo) will not be receiving further updates. I've been using it for 1.21 and it's rock solid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants