使用MacPorts安装Scala后,找不到scala命令
我正在运行 Snow Leopard 并安装了 MacPorts。然后我安装了最新的(截至撰写本文时)Scala 版本:
$ sudo port install scala29
此后该怎么办?当我尝试执行 Scala 解释器时,我得到:
-bash: scala: command not found
I am running Snow Leopard and installed MacPorts. I then installed the latest (as of this writing) Scala version as:
$ sudo port install scala29
What to do after this? When I try to execute the Scala interpreter, I get:
-bash: scala: command not found
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我正在使用 MacPorts 2.1.2,情况似乎又发生了一些变化。
显示
nezda 建议的命令无法正常工作:
$ sudo port select --set scala2.9
给出错误
但以下帮助
激活 Scala 2.9
再次检查 scala
我现在可以运行 Scala。
I'm using MacPorts 2.1.2 and things seems to changed a bit again.
Shows
Command suggested by nezda does not work properly:
$ sudo port select --set scala2.9
gives error
But following helps
Activates Scala 2.9
Checking scala again
And I can run Scala now.
这似乎已经改变了。在 Lion + MacPorts 2.1.1 上,我必须执行以下操作:
验证这显示了版本:
我的显示:
如果没有选择,可以使用以下命令来选择:
打开一个新终端(确保
$PATH
是最新的)并验证scala
现在是 2.9.x。This seems to have changed. On Lion + MacPorts 2.1.1, I had to do the following:
Verify this shows the version:
Mine showed:
If it is not selected, you can use this command to select it:
Open a new terminal (ensuring
$PATH
is up to date) and verifyscala
is now 2.9.x.好的,所以我实际上必须搜索这个,因为自上次执行以来 Scala 安装已经发生了变化。可执行文件应该从 /opt/local/bin 链接,要在不给文件夹添加前缀的情况下使用它们,请执行以下操作:
现在您应该能够从任何目录运行 scala 命令。
截至 2013 年 1 月,此答案已过时,Arnost Valicek 的答案已知有效。
Okay, so I actually had to search this since the Scala install has changed since the last time I did it. The executables should have been linked from /opt/local/bin, to use them without prefixing the folders do this:
Now you should be able to run the scala command from any directory.
As of January 2013 this answer is outdated, Arnost Valicek's answer is known to work.
我认为是:
I think it's: