我有一台ubuntu机器在OpenVZ虚拟化下。当我运行fsc测试。scala得到:
Unable to establish connection to compilation daemon
然后ps aux
向我展示了许多像这样的过程
ren 17482 0.0 0.0 4908 1400 pts/0 S 00:29 0:00 /bin/bash --posix /usr/bin/scala -Djava.net.preferIPv4Stack=true scala.tools
ren 17490 0.2 0.5 1246676 24268 pts/0 Sl 00:29 0:00 java -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Stack=true -Xbootc
我已经用尽了如何使它工作的想法,版本是Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL
。什么好主意吗?
找到了这个,所以:
- selinux未安装
- export | grep SCALA不返回任何东西,但是scala和scala编译/运行良好,所以我假设这一步可以 ping localhost - works
- fsc -reset -相同的错误
- fsc -verbose>> logfile.log 2>&1输出如下:
Fast Scala compiler version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL [Given arguments: -verbose] [Transformed arguments: -verbose -current-dir /home/ren] [VM arguments: ] [Temp directory: /tmp/scala-devel/ren] [Port number: 36737] java.net.SocketException: Invalid argument or cannot assign requested address [Connecting to compilation daemon at port 36737 failed; re-trying...] No compile server running: starting one with args '' [Executing command: scala scala.tools.nsc.CompileServer -v] Starting CompileServer on port 34962 Redirect dir is /tmp/scala-devel/ren/output-redirects [Port number: 34962] java.net.SocketException: Invalid argument or cannot assign requested address [Connecting to compilation daemon at port 34962 failed; re-trying...] [Port number: 34962] java.net.SocketException: Invalid argument or cannot assign requested address [Connecting to compilation daemon at port 34962 failed; re-trying...] No compile server running: starting one with args '' and so on ...
编辑2:
好吧,像这样启动编译服务器scala scala.tools.nsc.CompileServer -v
实际上工作!似乎fsc确实启动了所有这些服务器,但由于某种原因,它决定不启动。fsc -server localhost:port test.scala
作品。
似乎fsc使用hostname
连接到编译服务器。我的主机名对ping没有响应。在/etc/hostname
中将其更改为localhost修复了这个问题。