Apache Class Commons Math的NoClassDefFoundError

没有人

我想使用来自Apache Commons的PoissonDistribution,但总是收到错误a NoClassDefFoundError

编码:

import org.apache.commons.math3.distribution.PoissonDistribution;

public class Test {

    public static void main(String[] args) {
        PoissonDistribution p = new PoissonDistribution(5.0);

    }

}

错误信息:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/math3/distribution/PoissonDistribution
    at Test.main(Test.java:6)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.math3.distribution.PoissonDistribution
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 1 more

到目前为止,我已完成的操作:commons-math3-3.6.1.jar文件位于项目文件夹内的文件夹中,并通过Project->Properties->Java Build Path->Libraries我添加了JAR文件,然后在其旁边的“订购和出口”标签中选择了该文件jar文件。

谢谢你的帮助!

没有人

好的,巧合的是,我找到了解决方案:

我的问题是我将JAR添加到了模块路径中,而不是项目属性中的类路径中。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

java.lang.NoClassDefFoundError:org / apache / commons / lang3 / ObjectUtils

apache.commons中带有SwallowedExceptionListener的NoClassDefFoundError

使用Apache Commons Math从数字系列获取中位数

NoClassDefFoundError:org / apache / commons / lang3 / StringUtils

Google Guava与Apache Commons

Apache Commons FTPClient挂起

使用Apache Commons Math确定置信区间

线程“主”中的异常java.lang.NoClassDefFoundError:org / apache / commons / logging / LogFactory

Apache Commons FTP问题

如何从Apache Commons Math查找伪逆-Java库

错误:NoClassDefFoundError:org / apache / commons / logging / LogFactory

java.lang.NoClassDefFoundError:无法解决以下问题:Lorg / apache / commons / logging / LogFactory

#java.lang.NoClassDefFoundError:org / apache / commons / digester / Digester

java.lang.NoClassDefFoundError:org / apache / commons / collections / Transformer

使用Apache Commons Math插值函数

NoClassDefFoundError:org.apache.commons.lang.StringUtils

Apache Commons Unzip方法?

java.lang.NoClassDefFoundError:Lorg / apache / commons / collections / FastHashMap;

如何将RealMatrix与RealVector相乘(org.apache.commons commons-math3)

Apache Commons Math:SummaryStatistics的值存储在哪里?

如何修复org.apache.commons.math3.exception.ConvergenceException

如何解决NoClassDefFoundError:Apache Commons Lang Android

javax.servlet.ServletException:java.lang.NoClassDefFoundError:org / apache / commons / io / output / DeferredFileOutputStream

java.lang.NoClassDefFoundError:org / apache / commons / io / FileUtils

Apache Commons CLI(选项)

使用Apache Commons Math所需的指导

Spring Boot Tiles-java.lang.NoClassDefFoundError:org / apache / commons / beanutils / MethodUtils

Apache Commons Math 上的 Mann-Whitney U 测试

为什么“import org.apache.commons.math3.distribution.ChiSquaredDistribution”有效而“import org.apache.commons.math3”无效?