gpt4 book ai didi

java - 简单的 scala 程序给出错误 : java. lang.InknownClassChangeError

转载 作者:行者123 更新时间:2023-12-01 11:17:50 27 4
gpt4 key购买 nike

我正在使用斯坦福的主题建模工具包

这是一个在 eclipse 上运行的简单的 scala 程序

为什么我不断收到此错误线程“main”java.lang.InknownClassChangeError中的异常:实现类

import scalanlp.io._;

object Main {
def main(args: Array[String]) {

println("added value"+c);

val pubmed = CSVFile("pubmed-oa-subset.csv");

println("Success: " + pubmed.data.size + " records");


}
}

此处完全错误

Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at scalanlp.io.CSVFile$.CSVFileAsParcel(CSVFile.scala:73)
at Main$.main(t1.scala:27)
at Main.main(t1.scala)

最佳答案

提供的代码是正确的...问题(很可能)是 Scala 版本问题。该 jar 是用 Scala 2.8(5 年前)编译的,引用自 http://nlp.stanford.edu/software/tmt/tmt-0.4/ :

TMT was written during 2009-10 in what is now a quite old version of Scala, using a linear algebra library that is also no longer developed. Some people still use it and find it a friendly piece of software for LDA and Labeled LDA models, and more power to you, but at this point we really can't offer any support or fix any problems. Sorry about that.

这里描述的IncompleteClassChangeError What causes java.lang.IncompatibleClassChangeError? ,是由于二进制不兼容造成的。因此唯一的选择是安装旧版本的 Scala,最好是 2.8.0。

关于java - 简单的 scala 程序给出错误 : java. lang.InknownClassChangeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31583536/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com