如何运行 Fast Scala Compiler 远程服务器?
我想设置一个在盒子上运行的 fsc 进程,然后我可以远程访问该进程。
我知道我需要共享一个临时目录。
然而,我什至很难让它在我的笔记本电脑上运行。
我正在尝试:
fsc -Djava.io.tmpdir=/tempscala -server 127.0.0.1:8080
但它只是给了我使用选项......
帮助?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您误解了 fsc 的作用。 fsc 启动一个守护进程,该进程在编译调用之间保持活动状态,因此不必每次都执行所有初始化工作。除非您有共享文件系统,否则您实际上无法在完全独立的机器上运行编译。
正如 Jeha 所说,您应该使用 -D 指定一个临时目录,然后是您想要编译的 scala 文件(这就是您获得使用说明的原因 - 它缺少一条重要的信息)。
您还需要删除 -server,因为 fsc 会选择它将运行的端口,并在您第一次运行它时告诉您。你会看到类似这样的行:
然后,当你想重新编译时,你只需再次调用相同的命令(仍然不需要指定服务器端口),最后当你完成后运行
fsc -shutdown
请参阅此处查看手册页
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:
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