ClassNotFoundException when clickgui gets initialized
See original GitHub issue``Hello, i’m having an issue when trying to initialize the clickgui,i think its a gradle problem. everything works fine on the runClient task but when trying to initialize the client from the jar in the minecraft launcher it crashes with this error: https://pastebin.com/wdqdxha0 This is my build.gradle file:
plugins {
id 'fabric-loom' version '0.7.27'
id 'maven-publish'
id "com.github.johnrengelman.shadow" version "7.0.0"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
minecraft {
}
repositories {
mavenLocal()
mavenLocal()
jcenter()
maven {
url = "https://jitpack.io"
}
maven {
name = 'lukflug'
url = 'https://lukflug.github.io/maven'
}
}
dependencies {
//to change the versions see the gradle.properties file
minecraft ("com.mojang:minecraft:${project.minecraft_version}")
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
implementation include("com.lukflug:panelstudio:0.1.8")
modImplementation include("com.lukflug:panelstudio-mc16:0.1.9")
implementation include('club.minnced:java-discord-rpc:2.0.1')
}
shadowJar{
dependencies{
include(dependency("com.lukflug:panelstudio"))
include(dependency("com.lukflug:panelstudio-mc16"))
include(dependency('club.minnced:java-discord-rpc:2.0.1'))
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
remapJar {
dependsOn(shadowJar)
input.set(shadowJar.archiveFile)
}
java {
withSourcesJar()
}
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
builtBy remapJar
}
artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
It works fine in runClient task with panelstudio and it shows up correctly but when building it to jar and launching it it crashes with this error, i checked and deleted the clickgui, then rebuilt the jar and launched and it worked fine again so its probably an issue caused by me importing uncorrectly panelstudio from gradle. would be awesome if you could help me
Issue Analytics
- State:
- Created 2 years ago
- Comments:26 (2 by maintainers)
Top Results From Across the Web
java.lang.NoClassDefFoundError: Could not initialize class XXX
You are getting a java.lang.NoClassDefFoundError which does NOT mean that your class is missing (in that case you'd get a java.lang.
Read more >Viewing online file analysis results for 'waohack_1.06_deobf.jar'
Indicators. Not all malicious and suspicious indicators are displayed. Get your own cloud service or the full version to view all details.
Read more >Forge Crash at Initializing Screen - Java Edition Support
I just decided to install Forge to get a few mods (never used Mods before but ... ClassNotFoundException: net.minecraft.client.renderer.
Read more >"Error: java.lang.NoClassDefFoundError: Could not initialize ...
Hope I can get some help with this, I'm trying to launch a 155 custom modpack on Minecraft version 1.18.2 using the Curse...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Um tensor? Good joke
Lol