JDBC is not linking to neoforge jar
Hi! I am creating a server-side neoforge mod, that uses jdbc (sqlite).
I am adding it to project via Gradle:
dependencies { implementation("org.xerial:sqlite-jdbc:3.49.1.0") }
But the resulting jar size is only 9 kb, that's strange. And I see output when launching minecraft server:
Exception caught during firing event: java.lang.ClassNotFoundException: org.sqlite.JDBC
How can I link it to my executable or how you guys call it in Java?4 Replies
⌛
This post has been reserved for your question.
Hey @horse! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
By default, JAR files are thin meaning they only contain the code for the project itself and not dependencies
it is possible to create a fat JAR or jar with dependencies (sometimes also called a shadow JAR) but in your case it's (probably a bit more complicated)
You probably don't want all dependencies included in your JAR. For example, youi probably have a dependency on the mod APIs which shouldn't be part of the JAR - since that's provided by the mod loader (or whatever that's called)
so you have the option of repackaging/shadowing sqlite-jdbc (including it in your JAR) or maybe you can just provide multiple JARs: Your mod and sqlite-jdbc so both must be added to the application
And the APIs might have additional logic for how these dependencies are declared
so there might be a neoforge specific way of declaring dependencies like that
btw FYI Java loads/links classes, methods and fields symbolically (by name) and all of that happens at runtime
ping to get you notified
thanks
but after trying all stuff and going through all stages of depression i decided to just use json's
this undocumented shit does not cost my nerves
Post Closed
This post has been closed by <@1308094577827385385>.