eclipse - Test runs on command line, fails in Scala-IDE
问题描述
When right-click running a test class, Eclipse failed with
Caused by: java.lang.NoClassDefFoundError: scala/Product$class
at org.scalatest.time.Days$.<init>(Units.scala:291)
at org.scalatest.time.Days$.<clinit>(Units.scala)
at org.scalatest.time.Span$.<init>(Span.scala:585)
at org.scalatest.time.Span$.<clinit>(Span.scala)
at org.scalatest.tools.Runner$.<init>(Runner.scala:779)
at org.scalatest.tools.Runner$.<clinit>(Runner.scala)
at org.scalatest.tools.Runner.main(Runner.scala)
... 6 more
Caused by: java.lang.ClassNotFoundException: scala.Product$class
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 13 more
Yet it ran in the command line with sbt test
. The libraries have been updated as described in java.lang.NoClassDefFoundError: scala/Product$class.
This happened with the latest Scala IDE (4.7.0-vfinal-2017-09-29T14:34:02Z-Typesafe
) with the patmat project from Coursera's scala course.
What is the cause and how can it be fixed?
Requested info
The Java Build Path is
解决方案
Please use the Scala library version 2.11 as the other Scala based dependencies like scala-xml and scalatest are based on Scala library version 2.11
推荐阅读
- javascript - 将另一个数组中的数组对象打印成javascript中的特定格式
- paypal - 用于试用期订阅的 PayPal IPN
- c# - 如何通过 Unity 访问服务器上的 PHP 文件以进行 MySQL 数据库操作?
- javascript - 如何使用猫鼬更新现有用户的密码?
- python - 如何在 python django 中使用字典值将 raw 传递给 xxx.html
- python - 从烧瓶 api 获取参数
- mysql - MySqlx xDevApi 驱动程序 CDK 错误:连接被拒绝(通用:111)mysql-connector-c++
- javascript - 如何设置打字稿以在父级中使用连接的组件?
- java - 如何从 2 个列表中制作地图?
- c - 使用 udev 函数时内存泄漏