java.lang.NoSuchMethodError: jodd.Jodd.init(Ljava/lang/Class;)V

918 views Asked by At

I am trying to use the Jodd-http version 3.6.6 library in a simple application. The application runs fine on a test machine which has java 1.8 installed but when I try to run the same application on another machine with java 1.7 it throws this excption.

java.lang.NoSuchMethodError: jodd.Jodd.init(Ljava/lang/Class;)V

is this version of jodd-http is not compatible with java 1.7?

2

There are 2 answers

1
Roger On

Jodd modules are distributed in two flavors:

1 .as a single bundle jar, that contain all Jodd modules in one distribution archive.

  1. separate jar for each module.

So Jodd may be used on any platform where there is a suitable Java 7+ runtime environment.

1
igr On

This shouldn't be related to java version, but to existance of jodd libraries - are you sure you have jodd-core jar in your classpath?

Because jodd-http can't work without jodd-core:) And from your exception it looks like only jodd-http jar is present in the classpath; but not jodd-core.

Can you check this please?

I don't know if you use maven repo (jCentar or Maven Central), but it would be good so all this dependencies can be loaded automatically.

EDIT:

Check httpclient example in the https://github.com/oblac/jodd-quickstart

EDIT: Check the classloaders - if they see the Jodd class (or any class from jodd-core); maybe the classloader for some reason dont see it; or there are multiple different versions of jodd-http on the classpath.