Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commons Math - could not find class org.apache.commons

I have downloaded the binary Zip from here. I extracted the zip to a folder. Then I right clicked on libs folder in Eclipse. I Imported the *.jar file to the libs folder, and then I right clicked on it and added to path. I added

 import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;

to my java file, and i am adding values to

DescriptiveStatistics rStandardDeviation = new DescriptiveStatistics();

and after that I run the math part by:

double bMean = bStandardDeviation.getMean();
double rStd = rStandardDeviation.getStandardDeviation();

No errors on compile, clean, or build. When I attempt to run the app on my phone i get:

Could not find class 'org.apache.commons.math3.stat.descriptive.DescriptiveStatistics', referenced from method com.example.mydemo.MainActivity.<init>

Any ideas anyone what is going wrong?

Thank you

like image 381
KingsInnerSoul Avatar asked Mar 02 '26 02:03

KingsInnerSoul


1 Answers

In your Build Configuration, make sure you check your library to be exported in Order and Export. See

enter image description here

like image 161
Chris Spack Avatar answered Mar 04 '26 15:03

Chris Spack