Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.19.2] Unable to use external libraries at runtime (NoClassDefFoundError)

Featured Replies

Posted

Hi!

I've been trying to use external libraries like JOML (for animating) and Jsoup (for html parsing), It compiles fine, however at runtime if I call a class that uses one of these external libraries it crashes my game saying "ClassNotFoundException: {external library maven url here}".

Here's my relevant code:

// build.gradle

dependencies {
    minecraft "net.minecraftforge:forge:${mc_version}-43.2.0"
	
	// Other dependencies...	

    implementation "org.joml:joml:${joml_version}"
    implementation "org.jsoup:jsoup:${jsoup_version}"
}
// gradle.properties

joml_version=1.10.5
jsoup_version=1.16.1
// Class using external joml library (crashes when I call this method)

    public Quaternionf toQuatf(float x, float y, float z, float w)
    {
        return new Quaternionf(x, y, z, w);
    }

If I'm missing something please let me know! I'm not so familiar with Gradle as I originally used maven Poms/XMLs with Java xD

7 hours ago, SnakerBone said:

I've been trying to use external libraries like JOML (for animating) and Jsoup (for html parsing), It compiles fine, however at runtime if I call a class that uses one of these external libraries it crashes my game saying "ClassNotFoundException: {external library maven url here}".

 

First, use Mojang's math functions pre 1.19.3. If you want to use JOML, update to 1.19.3 or later, since Mojang switched off the library.

 

Second, non-mod artifacts need to be added using the `minecraftLibrary` configuration, so it gets picked up by the class loader.

  • Author
39 minutes ago, ChampionAsh5357 said:

First, use Mojang's math functions pre 1.19.3. If you want to use JOML, update to 1.19.3 or later, since Mojang switched off the library.

 

Second, non-mod artifacts need to be added using the `minecraftLibrary` configuration, so it gets picked up by the class loader.

Thanks 🙂 I wasn't aware mojang started using JOML in 1.19.3 my bad haha

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.