1

I'm getting NoClassDefFoundError exception when I run this main class through Eclipse

import org.json.simple.parser.JSONParser;

public class A {
    public static void main(String args[]) throws IOException {
        JSONParser jsonParser = new JSONParser();
        // code
    }
}

Exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser
Caused by: java.lang.ClassNotFoundException: org.json.simple.parser.JSONParser

I am implementing below dependency in gradle file:

implementation 'com.googlecode.json-simple:json-simple:1.1.1'
thokuest
  • 5,800
  • 24
  • 36
Hardik Rana
  • 476
  • 1
  • 6
  • 16

1 Answers1

0

Have you changed/set your classpath to your current project? Maybe that's why your program is giving you error

  • https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java. Browse this link and find out what's the problem –  Sep 29 '20 at 07:01