一.问题
IDEA中运行scala报错:Exception in thread “main” java.lang.NoClassDefFoundError: scala/tools/nsc/interpreter/ILoop
class Test {
def main(args: Array[String]): Unit = {
print("hello world")
}
}
二.解决
scala中类文件为object,所以应修改class为object,同时如果是class,点击右键会出现Run scala console。
同时需要注意,初始创建文件,默认是class选项,要修改为object选项。