如何在 Ubuntu 12.04 上的 Eclipse/Scala-IDE 中的工作表中获得内联结果?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17995704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get inline results in a worksheet in Eclipse/Scala-IDE on Ubuntu 12.04?
提问by kramer65
I've got the Scala-IDE installed on my Mac and on my pc with Ubuntu 12.04. In there I created a project, with a package and in there a worksheet. On my mac, the worksheet shows results of every line on the same line on the right. For example:
我已经在 Mac 和装有 Ubuntu 12.04 的电脑上安装了 Scala-IDE。在那里我创建了一个项目,其中包含一个包和一个工作表。在我的 Mac 上,工作表在右侧的同一行中显示每一行的结果。例如:
package mypackage
object myworksheet {
println("Hello World!") > Hello World!
}
On Ubuntu however, I do not see the result on the right. I've tried making changes in the worksheet and saving it, but it makes no difference.
但是,在 Ubuntu 上,我没有看到右侧的结果。我试过在工作表中进行更改并保存它,但没有任何区别。
Does anybody know how I can get these inline results on my Ubuntu machine as well?
有人知道如何在我的 Ubuntu 机器上获得这些内联结果吗?
回答by fgui
I had the same issue, adding -Dfile.encoding=UTF8 to eclipse.ini fixed the issue.
我遇到了同样的问题,将 -Dfile.encoding=UTF8 添加到 eclipse.ini 解决了这个问题。
For more details look at answer to the question: Results encoding in Scala Worksheet Eclipse plugin
有关更多详细信息,请查看问题的答案:Scala Worksheet Eclipse plugin 中的结果编码
回答by Philip
Having a space in the Project name was the problem for me. Creating a new project without the space resolved it.
项目名称中有一个空格对我来说是个问题。创建一个没有空间的新项目解决了它。
See this answer New scala worksheets not evaluated in Eclipse
回答by Animesh Srivastava
A very simple answer to your question-
对您的问题的一个非常简单的答案-
I agree that the project name should not contain a space, you can also
get Inline Result in Scala Worksheet
我同意项目名称不应包含空格,您也可以在 Scala Worksheet
New Project < Scala Project < Type a Name < Finish GO to src < Right CLick < Scala Worksheet
新建项目 < Scala 项目 < 输入名称 < 完成 GO 到 src < 右键单击 < Scala 工作表
P.S. Also here you don't need to Run
(just hit Ctrl+S to save) also you don't need to append extends App
to the obj worksheet name
.
PS 同样在这里你不需要Run
(只需按 Ctrl+S 保存)你也不需要附加extends App
到obj worksheet name
.
回答by KayV
Change the scala installation to default version.
将 scala 安装更改为默认版本。
Follow these steps:
按着这些次序:
- Project -> Right click -> Properties -> Scala Compiler
- Click Scala Installation drop down.
- Select "Latest 2.12 bundle (dynamic)" in drop down
- 项目 -> 右键单击 -> 属性 -> Scala 编译器
- 单击 Scala 安装下拉菜单。
- 在下拉列表中选择“最新 2.12 包(动态)”