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.

java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException

Featured Replies

Java noob here. Seasoned in other languages but haven't ever used Java in production.

I've already Googled and found solutions to this problem, but they do not work for me. Posting here just to make sure it's not an OSBot-specific issue. 

I followed step #1 on this OSBot tutorial. I added json-simple-1.1.jar to my project so I can use the following imports:

import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;

I also followed this video on how to ass a .jar to your classpath.

The issue occurs when I rebuild the artifact and refresh scripts in OSBuddy, after running it I get this stack trace saying it can't find the class, even though I already added it and it builds fine in IntelliJ IDE:

Quote

java.lang.NoClassDefFoundError: org/json/simple/parser/ParseException
    at script.REDACTED.onStart(REDACTED.java:145)
    at org.osbot.rs07.event.ScriptExecutor.iiiIIiiIIiIi(ah:57)
    at org.osbot.rs07.event.ScriptExecutor.start(ah:1)
    at org.osbot.FA.iiiIIiiIIiIi(zv:193)
    at org.osbot.zA.iIiIIiiIiiii(wab:15)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.ParseException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 8 more

Anyone know what's going on here? How can I get this new package added to the classpath so the error goes away?

Edited by Lansana Camara

The error comes from the way you built the script jar file, make sure you include the dependencies in the exported jar (simple json dependency in this case)

  • Author
4 minutes ago, Token said:

make sure you include the dependencies in the exported jar (simple json dependency in this case)

Hey, thanks for your response. Can you elaborate on this part a bit? In IntelliJ IDE 2019.1, I went to "File -> Project Structure -> Modules -> Dependencies" and then I added the json package .jar and also checked the box "Export" next to it, then hit "Apply" and "OK". 

This does not work, either.

4 minutes ago, Lansana Camara said:

Hey, thanks for your response. Can you elaborate on this part a bit? In IntelliJ IDE 2019.1, I went to "File -> Project Structure -> Modules -> Dependencies" and then I added the json package .jar and also checked the box "Export" next to it, then hit "Apply" and "OK". 

This does not work, either.

The script jar is built using an artifact, so look under artifacts and add the simple json jar under the output structure

  • Author
4 minutes ago, Token said:

The script jar is built using an artifact, so look under artifacts and add the simple json jar under the output structure

Ugh, IntelliJ is so stupid. Did what you said already, added the .jar from Project Libary and Global Library. Clicking "Library Files" to add it doesn't work, you have to click "Extracted Directory" to add it. Every StackOverflow answer says to click otherwise. 

Whatever, it's solved now. Thanks a bunch.

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.