错误:未找到:对象播放

时间:2017-07-21 10:24:01

标签: scala playframework sbt

实际上学习如何用scala编写代码,我需要一些帮助:

var json = [];
var length = 100000;
while(length--){
   json.push({id: length, name: length});
}
var time = new Date().getTime();
var dropdown = document.createElement('select');
json.forEach(function(item){
    var option = document.createElement('option');
    option.innerHTML = item.name;
    option.value = item.id;
    dropdown.appendChild(option);
})
console.log(new Date().getTime() - time)

我收到了错误消息:

import play.api.libs.json._
case class Alert(email: String, query: String)
 {
   def main(args: Array[String]): Unit = { println("Hello from main of class")}
}

我不知道问题出在哪里,我更新了IntelliJ,甚至在build.sbt中添加了缺少的库依赖项

Alert.scala:2: error: not found: object play
import play.api.libs.json._

One error found

1 个答案:

答案 0 :(得分:0)

我很确定他们在这个相关问题中解释得非常好:

object play not found in scala application