0

i dont know how to describe it but here is the code ive put in eclipse + the guide i used

https://codakid.com/guide-to-minecraft-modding-with-java/

[2021-06-12 22:53:07] [INFO ] Natives: C:\Users\amine\Desktop\mc gd hax\build\natives [2021-06-12 22:53:07] [INFO ] Main Class: net.minecraft.launchwrapper.Launch [2021-06-12 22:53:07] [INFO ] Srg2Mcp: C:\Users\amine\Desktop\mc gd hax\build\createSrgToMcp\output.srg [2021-06-12 22:53:07] [INFO ] Extra: [] [2021-06-12 22:53:07] [INFO ] Running with arguments: [--version, 1.12, --assetIndex, 1.12, --assetsDir, C:\Users\amine.gradle\caches\forge_gradle\assets, --accessToken, {REDACTED}, --userProperties, [], --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker] Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at net.minecraftforge.legacydev.Main.start(Main.java:86) at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29) Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at net.minecraft.launchwrapper.Launch.(Launch.java:34) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) ... 6 more

1 Answer 1

2

Java 9 or later is not supported. Make sure you are using java 8.

To see your current version, type this in the command line:

java -version
Sign up to request clarification or add additional context in comments.

5 Comments

i am using version 8
Is eclipse using JDK 8? Eclipse could be using a bundled jdk.
so how to check
I'm not sure, I don't have eclipse installed, but if you create a test project and use this as the main function it will print out the version of the jdk: public static void main(String[] args) { System.out.println(System.getProperty("java.version")); }
You can set the version of jdk you want to use: stackoverflow.com/a/2573847.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.