tags:

views:

109

answers:

1

Running a scala script on Mac OS X results in the following error:

Unable to establish connection to compilation daemon

I found a page reporting the same problem:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576568

To solve the problem, the page said:

Can you please tell what does /etc/sysctl.d/bindv6only.conf contain?

If the value is 1, can you try to:

1) sudo sed -i 's/net.ipv6.bindv6only\ =\ 1/net.ipv6.bindv6only\ =\ 0/' \ /etc/sysctl.d/bindv6only.conf && sudo invoke-rc.d procps restart

2) Then, run scala/fsc as usual and see if the bug is still there.

But I can't find a bindv6only.conf in my Mac OS X. How can I solve the problem?

-- System Information:

Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20)

Mac OS X 10.6.3

+2  A: 

Have you tried setting the Java property java.net.preferIPv4Stack to disable Java's IPv6 ?

For more details see here.

Brian Agnew
I tried a following line and got the same the problem again, ummm:scala -Djava.net.preferIPv4Stack=true HelloWorld.scala
wataradio
@wataradio On Scala 2.7.x, `scala -D...` doesn't really work. Use `JAVA_OPTS` instead.
Daniel
I tried JAVA_OPTS in .bashrc like this: export JAVA_OPTS="-Djava.net.preferIPv4Stack=true". But the same problem occured again.
wataradio
I have found another page reporting the same problem(http://scala-programming-language.1934581.n4.nabble.com/Unable-to-establish-connection-to-compilation-daemon-td1999193.html). The page reported it was specific to Mac OS X. But I couldn't find a solution in the page.
wataradio
I tried this guide "The Fast Scala Compiler and the OS X Firewall" (http://www.scala-lang.org/node/294), and confirmed it doesn't work.
wataradio