Scala Install On Mac By Homebrew

原创
前天 11:01
阅读数 29

Scala

Follow the Scala website:https://docs.scala-lang.org/getting-started/index.html

Use Homebrew only one command. looks very simple. 

# 
brew install coursier/formulas/coursier && cs setup

But, my homebrew need to upgrade, and it is very slow. So have to use the proxy for the terminal...

Finally, installed the Scala.

➜  ~ brew install coursier/formulas/coursier && cs setup
Running `brew update --auto-update`...
==> Downloading https://github.com/coursier/coursier/releases/download/v2.1.0-M6-49-gff26f8e39/coursier
Already downloaded: /Users/qiaor/Library/Caches/Homebrew/downloads/0243971074ef1e117ff41ca83c6e48ff3f4d2f972a1512f2ff3e63ffd26d8c18--coursier
==> Downloading https://github.com/coursier/coursier/releases/download/v2.1.0-M6-49-gff26f8e39/cs-x86_64-apple-darwin.gz
Already downloaded: /Users/qiaor/Library/Caches/Homebrew/downloads/df0c57e9f493cec113ba9bda9ece0a98ff6ecb8642b5d422724f91a72a6239a6--cs-x86_64-apple-darwin.gz
==> Installing coursier from coursier/formulas
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/coursier/2.1.0-M6-49-gff26f8e39: 5 files, 57.7MB, built in 3 minutes 20 seconds
==> Running `brew cleanup coursier`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Checking if a JVM is installed
Found a JVM installed under /Users/qiaor/workspace/IDE/zulu17/zulu-17.jdk/Contents/Home.

Checking if ~/Library/Application Support/Coursier/bin is in PATH
  Should we add ~/Library/Application Support/Coursier/bin to your PATH via ~/.profile, ~/.zprofile, ~/.bash_profile? [Y/n] Y

Checking if the standard Scala applications are installed
  Installed ammonite
  Installed cs
  Installed coursier
  Installed scala
  Installed scalac
  Installed scala-cli
  Installed sbt
  Installed sbtn
  Installed scalafmt

➜  ~ scala -version
zsh: command not found: scala

Config the .zshrc

➜  ~ scala -version
zsh: command not found: scala
➜  ~ less .bash_profile 
➜  ~ vim .zshrc 
➜  ~ source .zshrc 
➜  ~ scala -version
Scala code runner version 3.1.3 -- Copyright 2002-2022, LAMP/EPFL

sbt - scala build tools

like gradle/maven for java, install guide link: here.

➜  ~ brew install sbt
Running `brew update --auto-update`...
==> Downloading https://ghcr.io/v2/homebrew/core/sbt/manifests/1.7.1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/sbt/blobs/sha256:f0ae85a514c49e1e3c1412b42e34ae29603ada77cf3361226e4dcbf66fcdfede
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:f0ae85a514c49e1e3c1412b42e34ae29603ada77cf3361226e4d
######################################################################## 100.0%
==> Pouring sbt--1.7.1.all.bottle.tar.gz
==> Caveats
You can use $SBT_OPTS to pass additional JVM options to sbt.
Project specific options should be placed in .sbtopts in the root of your project.
Global settings should be placed in /usr/local/etc/sbtopts

Homebrew's installation does not include `sbtn`.
==> Summary
🍺  /usr/local/Cellar/sbt/1.7.1: 8 files, 3.7MB
==> Running `brew cleanup sbt`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
➜  ~ sbt --script-version
1.7.1

Hello world

Using Intellij IEEA better to create scala project. Plz make sure install the scala plugin.

website link is: create project in command line

https://index.scala-lang.org/ like the maven repository

scala exercises/tutorial

好了, 到这一步就可以放弃了: 从入门到放弃

展开阅读全文
加载中

作者的其它热门文章

打赏
0
0 收藏
分享
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部