Posted December 2, 20222 yr Hi, I am currently coding a mod that needs javafx as dependency, but whatever i try it just doesn't want to load or build my mod... If i import any of the javafx classes in my mod, the mod just stops working. To get javafx into the mod i shadow all of the dependencies into the jar with the code below but the build task errors with the error below... Does someone know what i am doing wrong? I also tried just putting the javafx jars in my mods folder but that didn't work, so i think i have to shadow them in... Also sometimes when i change the way i shade the dependencies it does build the mod, but Forge fails to load it, forge gives me the error listed under the other error... For extra info: i am able to build the jar perfectly fine without the shading configurations { shade compile.extendsFrom(shade) } dependencies { shade "org.openjfx:javafx-web:19:win" shade "org.openjfx:javafx-graphics:19:win" shade "org.openjfx:javafx-controls:19:win" shade "org.openjfx:javafx-base:19:win" } shadowJar { dependencies { } configurations = [project.configurations.shade] duplicatesStrategy DuplicatesStrategy.EXCLUDE //prevent duplicates classifier "" //prevent creation of unshadowed jar } reobf { //reobfuscate the shadowed jar shadowJar {} } Quote Execution failed for task ':reobfShadowJar'. > java.lang.IllegalArgumentException (no error message) Quote The game crashed whilst there was a severe problem during mod loading that has caused the game to fail Error: net.minecraftforge.fml.common.LoaderException: java.lang.ClassNotFoundException: me.gwoonryan.videoplayer.VideoPlayer (VideoPlayer is the main class that imports javafx classes) Edited December 2, 20222 yr by gwoonryan More specific info added
December 3, 20222 yr The recommended method to do this now is through the JarInJar system. There are docs for it, but I recommend using the mdk as an example to add them.
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.