commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Meyer <meye...@virginia.edu>
Subject Re: [math] NormalDistributionImpl and NoClassDefFoundError:, MathException
Date Thu, 11 Jun 2009 16:46:25 GMT
> I am using the following code in a method that catches and throws=20
> org.apache.commons.math.MathException.
>=20
> NormalDistributionImpl normal =3D new NormalDistributionImpl();
> double invNorm =3D normal.inverseCumulativeProbability(itemDifficulty);
>=20
> I import the class using
>=20
> import org.apache.commons.math.MathException;
>=20
> but when I compile and run my code I get this error message=20
> java.lang.NoClassDefFoundError: org/apache/commons/math/MathException
>=20
> Any ideas what is happening? With my import statement, it seems like I
>=20
> should not be getting this error.

Do you have the commons-math jar in your classpath at runtime ?

Luc

I am using Netbeans and I have added the commons-math jar as a library. Is that the same thing?
The following simple test case works fine, but the complete application produce the error.

package test;

import org.apache.commons.math.MathException;
import org.apache.commons.math.distribution.NormalDistributionImpl;


/**
 *
 * @author meyerjp
 */
public class Main {

    


    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        NormalDistributionImpl normal = new NormalDistributionImpl(0.0,1.0);
        try{
            double invNorm = normal.inverseCumulativeProbability(0.4);
            System.out.println(invNorm);
        }catch(MathException ex){
            ex.printStackTrace();
        }


    }

}






Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message