#java.lang.NoClassDefFoundError: org/json/JSONObject
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Did you build a fat jar or indicated the dependencies?
can you be clear? iam brazilian so its a bit hard to understand, i build the jar file with gradle/build
if you are talking about the JSON dependencie
i just pasted that on the gradle.proprieties
dependencies {
implementation group : 'org.json', name : 'json', version : '20220924'}
Detected code, here are some useful tools:
dependencies {
implementation group : 'org.json', name : 'json', version : '20220924'}
That dependency is a seperate jar
so when you run your code that jar has to be on your classpath
jar by default only contains the code you wrote
it doesn't have your dependencies
you need to either have the dependency on classpath, or merge it into your jar
how would they do this? (not very gradle savy)
there's a gradle plugin that does that
your jar ends up having both your .class files and their .class files
can you helpme?
how to put i on classpath?
instead of building with the build task, use the buildDist (cant remember the exact name) which creates a self-sufficient distribution and .bat/.sh files to run it
you need either the application plugin, or java, or both
would that work?
oh look its minecraft again
i didnt find it to be honest
its
lmao
iam trying create json files but minecraft have no support for it
then you will need to shade the deoendency
how
wdym
it has gson
included
if it's sufficient for your purposes, use it
really? i didnt find it
I'm not sure which version is this, but 1.19 definitely has it
it definittely has some sort of json library since it needs to parse datapacks somehow
1.16.5 also should have it
i mean, ik have datapacks but i was trying create the file inside config folder
that datapacks doenst allow
if you want configs, use the config API
it doenst let me add hashmaps
i cant save configs like that
"minecraft:wither" = {
minions: "minecraft:creeper"
cooldown: 5
}
Detected code, here are some useful tools:
configs api is just for simple stuff
just let me save List
or integers, bools etc
HashMap no
that is why i was trying use json
then create a datapack system for your mod
so how do i do it?
well then you're going against what other mod guys would tell you
and against common sense
yes, so how do i shade the dependency?
dunno 🙂
bruh
I dont want