Reputation: 3
I've been wanted to start making my own Minecraft mod but I can't even get past the first step which is to start the game with a template mod. I've downloaded the forge mdk for 1.12.2, I've downloaded jdk-8u291, I've downloaded jre-8u291 but nothing! I've made progress though. Originally the Template was showing errors but I fixed it. I think I'm one step away from accomplishing this but I'm at a roadblock.
I have an unmodified version of the forge mdk for 1.12.2, but every time I get to the final step of eclipse where to set the run Configuration to runClient and change {MC_VERSION} to 1.12, I get this error in the console.
[2021-05-28 04:44:36] [INFO ] Natives: C:\Users\matth\OneDrive\Documents\ForgePractice\build\natives
[2021-05-28 04:44:36] [INFO ] Main Class: net.minecraft.launchwrapper.Launch
[2021-05-28 04:44:36] [INFO ] Srg2Mcp: C:\Users\matth\OneDrive\Documents\ForgePractice\build\createSrgToMcp\output.srg
[2021-05-28 04:44:36] [INFO ] Extra: []
[2021-05-28 04:44:36] [INFO ] Running with arguments: [--version, 1.12, --assetIndex, 1.12, --assetsDir, C:\Users\matth\.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.<init>(Launch.java:34)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
... 6 more
Upvotes: 0
Views: 1580
Reputation: 48632
You say "I've downloaded jdk-8u291, I've downloaded jre-8u291", but you didn't use them correctly. The relevant part of your error is 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')
, which occurs when you try to run Minecraft 1.12.2 on a version of Java newer than 8. You're not using Java 8 even though you have it installed. Try uninstalling all other versions of Java so that you'll definitely use Java 8.
Upvotes: 0