斯卡拉玩 2.0。编译错误: IO error while decoding

标签 scala playframework playframework-2.0 sbt multi-module

我从 GitHub (https://github.com/henrikengstrom/roygbiv) 下载了多模块 Scala 项目,其中一个模块是 Play 2.0 模块。所以我可以使用 SBT 的 run 运行整个应用程序每个模块上的命令,一切正常。但是当我添加到 Play 2.0 模板( index.scala.html )非英文字符并在浏览器中按 F5 时,我得到编译错误:

IO error while decoding C:\Users...\web\target\scala-2.9.1\src_managed\main\views\html\index.template.scala with UTF-8 Please try specifying another one using the -encoding option



Play 2.0 模块我也使用 SBT 的 run 运行命令,不使用 Play安慰。

我检查了源文件编码 - 它是 UTF-8。还尝试了没有 BOM 的 UTF-8。

哪里可能有问题?

最佳答案

您可以尝试使用强制编码为 UTF-8 来启动 SBT。我读到了 post对于某些人来说,它有助于通过以下选项启动 SBT:

JAVA_TOOL_OPTIONS='-Dfile.encoding=UTF8'

然后 SBT 的第一行应该显示:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

关于斯卡拉玩 2.0。编译错误: IO error while decoding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16529753/

相关文章:

Scala Breeze 前缀标量乘法

scala - Play : Run tests with custom GuiceApplicationLoader

validation - Spring Boot pre api操作注释

java - Play Framework 2.0 : "Errorjava. lang.RuntimeException : org. xml.sax.SAXParseException;行号:1;列数:1;文件过早结束

scala - 压缩输出烫伤/级联 TsvCompressed

scala - 将自定义类型从 F# 转换为 Scala

scala - 在函数调用的值上创建一个迭代器

java - Play Framework 2.0 中的路由重载函数

java - Play 2.1。 WebSocket 没有 EntityManager 绑定(bind)到这个线程

java - Play Framework 2.0 表单助手 : from checkbox to List<String>