scala - 快速 Scala 编译器 : Unable to establish connection to compilation daemon

标签 scala fsc

我在 OpenVZ 虚拟化下有一台 ubuntu 机器。当我运行 fsc test.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 .有任何想法吗?

编辑:

找到 this , 所以:
  • selinux 未安装
  • 导出 | grep SCALA 不返回
    任何东西,但是 scalac 和 scala 编译/运行良好,所以我假设
    这一步没问题
  • ping 本地主机 - 工作
  • 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解决了这个问题。

    关于scala - 快速 Scala 编译器 : Unable to establish connection to compilation daemon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15509885/

    相关文章:

    F# 编译器抛出 OutOfMemoryException

    java - 如何运行 Fast Scala Compiler 远程服务器?

    Scala 数据结构 : chain of operations (such as mapValues, filter ...) 和中间结果

    scala - Dotty 提供什么来替换字体投影?

    compiler-construction - 如何使用 fsc.exe (F#) 或 csc.exe (C#) 包含 app.config 文件?

    f# - 使用引用汇编加速 F# 编译

    visual-studio - 更改Visual Studio 2010使用的F#工具

    scala - 从 Java 过滤 Scala 列表

    json - Spark Streaming Scala 将不同结构的json组合成一个DataFrame

    scala - 从 Play 框架 zentask 示例中了解 Scala 函数