TorRS Posted September 25, 2023 Share Posted September 25, 2023 No matter what I found online didn't work, I tried exporting as jar and runnable jars, and I even switched from Eclipse to IntelliJ and played around with the artifacts without success. In the script, everything looks alright but when I run the script I get the java.lang.NoClassDefFoundError. Would appreciate some help and guidance, Thanks Quote Link to comment Share on other sites More sharing options...
skillerkidos1 Posted September 25, 2023 Share Posted September 25, 2023 You followed all the steps here? Quote Link to comment Share on other sites More sharing options...
TorRS Posted September 25, 2023 Author Share Posted September 25, 2023 Yes, the script part works fine but when i try to turn one of my classes into a jar file and import them in another project it wont work If they are in the same project everything works as intended but the moment i try to export the class as a jar and import it and do everything the same it wont work and i get the error Ex code: Main class: @ScriptManifest(author = "Me", name = "example", info = "", version = 1, logo = "") public class Main extends Script { @Override public int onLoop() { Printer.testPrint(this); return 1000; } } Another class that I'm trying to turn into a jar file for the purpose of making it easier to implement in all of my scripts: import org.osbot.rs07.script.MethodProvider; public class Printer { public static void testPrint(MethodProvider mp){ mp.log("Hello world"); } } Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted September 26, 2023 Share Posted September 26, 2023 (edited) 9 hours ago, TorRS said: Yes, the script part works fine but when i try to turn one of my classes into a jar file and import them in another project it wont work If they are in the same project everything works as intended but the moment i try to export the class as a jar and import it and do everything the same it wont work and i get the error Ex code: Main class: @ScriptManifest(author = "Me", name = "example", info = "", version = 1, logo = "") public class Main extends Script { @Override public int onLoop() { Printer.testPrint(this); return 1000; } } Another class that I'm trying to turn into a jar file for the purpose of making it easier to implement in all of my scripts: import org.osbot.rs07.script.MethodProvider; public class Printer { public static void testPrint(MethodProvider mp){ mp.log("Hello world"); } } as far as I know you can't use jar files as dependency on OSBot as it does not read them when starting a script. When developing on the OSBot SDN we do have a dependency package which we can access from every script on that repo Edited September 26, 2023 by Khaleesi Quote Link to comment Share on other sites More sharing options...
TorRS Posted September 26, 2023 Author Share Posted September 26, 2023 Do you have any suggestions on how to approach this problem, the only other thing I can think of currently is just copy-pasting the code from script to script and I'm trying to avoid that. I would prefer if I was able to change it once and be able to import it in all the scripts. Thanks again for the responses guys Quote Link to comment Share on other sites More sharing options...
Gunman Posted September 26, 2023 Share Posted September 26, 2023 13 hours ago, TorRS said: Do you have any suggestions on how to approach this problem, the only other thing I can think of currently is just copy-pasting the code from script to script and I'm trying to avoid that. I would prefer if I was able to change it once and be able to import it in all the scripts. Thanks again for the responses guys Are you outing the dependency into the compiled jar? Quote Link to comment Share on other sites More sharing options...