We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I'm porting my mod to 1.18 with Forge 40.1.0, but have problem of NoClassDefFoundError for 3rd party scala library.
NoClassDefFoundError
Reproduce steps:
implementation(group: "org.json4s", name: "json4s-native_2.13", version: "4.1.0-M1")
ExampleMod.scala
package com.example.examplemod import net.minecraftforge.fml.common.Mod import org.apache.logging.log4j.LogManager import org.json4s.native.JsonMethods._ @Mod(ExampleMod.MOD_ID) object ExampleMod { final val MOD_ID = "examplemod" private val LOGGER = LogManager.getLogger LOGGER.info(parse(""" { "numbers" : [1, 2, 3, 4] } """)) }
runClient
Suppressed: java.lang.NoClassDefFoundError: org/json4s/native/JsonMethods$
I tested with multiple external scala libraries and did some experiments to solve it.
But these solutions aren't good to use in development. Do you have any better idea to deal with it?
The text was updated successfully, but these errors were encountered:
See this example from kotlin loader.
https://github.com/thedarkcolour/KotlinForForge/blob/site/thedarkcolour/kotlinforforge/gradle/kff-3.3.2.gradle#L18-L28 https://github.com/thedarkcolour/KotlinForForge/blob/site/thedarkcolour/kotlinforforge/gradle/kff-3.3.2.gradle#L44-L48
Create new configuration and add libraries to it. Then add them to runtime classpath as the example shows in line 24-28.
Sorry, something went wrong.
No branches or pull requests
Hi,
I'm porting my mod to 1.18 with Forge 40.1.0, but have problem of
NoClassDefFoundError
for 3rd party scala library.Reproduce steps:
implementation(group: "org.json4s", name: "json4s-native_2.13", version: "4.1.0-M1")
ExampleMod.scala
as below.runClient
, and it will throwSuppressed: java.lang.NoClassDefFoundError: org/json4s/native/JsonMethods$
I tested with multiple external scala libraries and did some experiments to solve it.
But these solutions aren't good to use in development. Do you have any better idea to deal with it?
The text was updated successfully, but these errors were encountered: