Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I'm trying to turn some packages into jar files so I can use them but I get java.lang.NoClassDefFoundError

Featured Replies

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 :)

  • Author

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");
    }
}
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 by Khaleesi

  • Author

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 :)

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?

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.