5

I want to set an fsc process running on a box that I can then access remotely.

I understand I need to share a temp directory.

However, I'm struggling to even get it going on my laptop.

I'm trying:

fsc -Djava.io.tmpdir=/tempscala -server 127.0.0.1:8080

but it just gives me the usage options...

Help?

R u c k s a c k
  • 784
  • 6
  • 17
  • I guess you provided some source files? – jeha Sep 06 '11 at 21:08
  • Why are you setting `-Djava.io.tmpdir=/tempscala`? Shouldn't it be like `fsc -verbose -d /tempscala foobar.scala`? – jeha Sep 06 '11 at 21:15
  • You need to share the _source_ and _target_ directory, as far as I know. I might be wrong, however -- using fsc on a remote server isn't rather obscure, and not necessarily working. – Daniel C. Sobral Sep 06 '11 at 21:42

1 Answers1

3

I think you're mis-understanding what fsc does. fsc starts a daemon process which stays alive between calls to compile, so it doesn't have to do all the initializing work each time. You can't actually run the compile on a completely separate box unless you have a shared file system.

As Jeha says, you should specify a temp directory with -D, then the scala files you wish to compile (this is why you're getting the usage instructions - it's missing a vital piece of information).

You also need to drop the -server, as fsc picks the port it's going to run on, and tells you it the first time you run it. You'll see lines something like this:

[Temp directory: /var/folders/oj/ojMgC8mDH4uK9fM5cjlK1E+++TI/-Tmp-/scala-devel/temp]
[Port number: 54056]
[Connected to compilation daemon at port 54056]

Then, when you want to recompile, you just call the same command again (still no need to specify server ports), then finally when you're done run fsc -shutdown

see here for the man pages

CPJ
  • 1,635
  • 1
  • 9
  • 9
  • 2
    I forgot to add, a gotcha I had in the beginning was it complaining that it couldn't find my files to compile. I'd made a typo in the classpath, but you have to -shutdown then re-run your fsc command with the fixed classpath as it doesn't notice that you've changed it otherwise. – CPJ Sep 08 '11 at 10:23