2

It seems it's missing the Java library Efficient Java Matrix Library(ejml), so I have downloaded from the sources here. I'm creating Maven Jar executable file and running on Openstack EDP Spark environment.

I'm having trouble figuring out how to solve this java.lang.NoClassDefFoundError: org/ejml/simple/SimpleBase

I also tried ejml version 0.23, 0.25, 0.27, 0.30, 0.31.

Exception in thread "main" java.lang.NoClassDefFoundError: org/ejml/simple/SimpleBase
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:195)
    at org.openstack.sahara.edp.SparkWrapper.main(SparkWrapper.java:17)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: org.ejml.simple.SimpleBase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  • have a look at this [NoClassDefFoundError question](https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java). You need to provide the library for JRE. – DevDio Sep 04 '17 at 12:32
  • Hi DevDio, I already saw these type of errors and also called all liberies of JRE, SPARK, SCALA, EJML but it wasn't show any error at the time of building JAR with dependices but when I am compiling this jar this will fire me that error many times even I used different EJML libs versions. – Dheeraj Chitara Sep 05 '17 at 06:13

1 Answers1

1

I know it's been 4 years, but in case anyone else is having the same issue, here is how I did it:

I'm using Android studio, and adding 'ejml-simple-0.39.jar' as a library had solved my problem.

Your build.gradle should have this line:

implementation files('libs/stanford-corenlp-4.4.0/ejml-simple-0.39.jar')

Don't forget to change it according to your library versions

Amira
  • 180
  • 2
  • 9