加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

scala 2.12.1 ClassNotFoundException Product $class

发布时间:2020-12-16 19:19:03 所属栏目:安全 来源:网络整理
导读:我最近更新了 scala从v2.11.8到2.12.1并获得了CNF异常: java.lang.ClassNotFoundException: scala.Product$class 我看到这个类是由scala-library.jar发布的. 运行scalatest时会发生错误(项目仍处于非常早期阶段,因此我只进行了测试). 你有什么主意吗?我在
我最近更新了 scala从v2.11.8到2.12.1并获得了CNF异常:

java.lang.ClassNotFoundException: scala.Product$class

我看到这个类是由scala-library.jar发布的.
运行scalatest时会发生错误(项目仍处于非常早期阶段,因此我只进行了测试).

你有什么主意吗?我在发行说明中找不到任何内容.

解决方法

特别是,在使用$class后缀命名的类中不再提供特征实现.您将在发行说明中找到有关“特征编码”的通知.

如果试验除了内置函数之外的任何依赖项,你可能想要使用sbt或ammonite.有一天,他们将有一个整洁的“平台”来帮助你.

$cat notraitclass.scala

package notraitclass

trait T {
  def t: Int = 42
}
$scalac211 notraitclass.scala
$ls notraitclass
T.class  T$class.class
$rm -rf notraitclass
$scalac notraitclass.scala
$ls notraitclass
T.class

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读