Jump to content

NoSuchMethodError for runClient on example mod


Recommended Posts

Hello, I'm just getting started with creating forge mods and am trying to get the example mod to run. I'm using forge 1.16.5-36.2.20, and have downloaded the corresponding mdk. I've changed the mapping to snapshot

mappings channel: 'snapshot', version: '20210309-1.16.5'

and have updated the example mod doClientStuff method to use gameSettings instead of options.

Building and running genIntellijRuns all works fine, but running runClient errors out. The run configuration is using the .main option for my project. I'm using the java 8 hotspot jvm.

Here's the stack trace I'm getting.

Exception in thread "main" [15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.NoSuchMethodError: sun.security.util.ManifestEntryVerifier.<init>(Ljava/util/jar/Manifest;)V
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.SecureJarHandler.createCodeSource(SecureJarHandler.java:66)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:275)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:136)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.Class.forName0(Native Method)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at java.lang.Class.forName(Class.java:348)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[15:43:04] [main/INFO] [STDERR/]: [java.lang.ThreadGroup:uncaughtException:1052]: 	at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108)

Please let me know if you need any more info!

Edited by doot
Link to comment
Share on other sites

I've done some digging and found some more info on where it's erroring out, it's failing to find the class "net.minecraft.client.main.Main". Not sure why though

(line 52 in FMLUserdevClientLaunchProvider.java)

Class.forName("net.minecraft.client.main.Main", true, launchClassLoader.getInstance()).getMethod("main", String[].class).invoke(null, (Object)arguments);


Edited by doot
correction after finding more info
Link to comment
Share on other sites

Ok I've finally found out what the issue is. In the java 8 jdk, the constructor to ManifestEntryVerifier was changed to take 2 arguments at some point, while it seems SecureJarHandler.java from the mod launcher expects the older one argument version of the constructor. I was using jdk8 333. I've switch to jdk8 211, sometime before this change was made, and now it works. I don't know at which release this change was so there're probably later jdks that can be used, I just went waayyyyy back just to get this stuff running.

I'm still pretty new to gradle so I don't know if there are gradle settings I can use to change the mod launcher or something, so any more info would be appreciated, but at least it runs for now.

Edited by doot
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.