scala开发环境配置(windows环境)
确认系统已经安装java8或以上的jdk
下载scala-2.11.8.msi
https://www.scala-lang.org/download/all.html
下载sbt-1.2.8.msi
https://www.scala-sbt.org/download.html
分别安装scala和sbt
配置sbt
修改sbt/conf/sbtconfig.txt
-Xmx512M -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m -Dsbt.log.format=true # 如果需要修改源 -Dsbt.override.build.repos=true # 如果希望修改本地仓地址 -Dsbt.boot.directory=D:/sbt/.sbt/boot -Dsbt.ivy.home=D:/sbt/.ivy2 -Dsbt.global.base=D:/sbt/.sbt -Dsbt.repository.config=D:/sbt/repositories # 如果需要设置代理 -Dsbt.repository.secure=false -Dhttp.proxyHost=proxyhost -Dhttp.proxyPort=proxyport -Dhttp.proxyUser=user -Dhttp.proxyPassword=password -Dhttps.proxyHost=proxyhost -Dhttps.proxyPort=proxyport -Dhttps.proxyUser=user -Dhttps.proxyPassword=password
2.修改源,如果sbt.repository.config不设置,需要在用户目录下的.sbt中新建repositories文件,设置了则在设置的目录中创建
如果使用华为云的sbt镜像则内容修改为
[repositories] local huaweicloud-ivy: https://mirrors.huaweicloud.com/repository/ivy/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] huaweicloud-maven: https://mirrors.huaweicloud.com/repository/maven/
下载并安装idea,下载scala-intellij-bin-2019.2.15.zip插件,解压到idea插件目录
打开idea,新建scala-sbt项目
设置sbt为系统安装的版本而不是idea内置的
vm参数的设置和sbtconfig.txt一样, 启动器为安装的sbt启动器文件路径
为项目添加scala-sdk
添加成功后会出现在modules中
设置scala目录为源目录( 注意不设置会导致找不到主类入口)
在scala目录下新建com目录,并添加HelloWord.scala文件,内容为
package com object HelloWorld{ def main (args: Array[] ): Unit = { print("Hello World!") } }
右键运行HelloWorld文件
参考:
https://gist.github.com/wsargent/072319c2100ac0aea4305d6f6eeacc08
https://blog.csdn.net/lovehuangjiaju/article/details/47746391
https://blog.csdn.net/iamlihongwei/article/details/72783459
https://stackoverflow.com/questions/13803459/how-to-use-sbt-from-behind-proxy
https://blog.csdn.net/liuxiao723846/article/details/80734490
https://stackoverflow.com/questions/52222156/scala-sbt-error-while-importing-sbt-project
https://blog.csdn.net/jameshadoop/article/details/52295710
https://blog.csdn.net/hongzhen91/article/details/81507140
https://blog.csdn.net/difffate/article/details/80631964
https://blog.csdn.net/yu0_zhang0/article/details/79237210
其他:
https://docs.google.com/document/d/1W38UZuDkPrVwxWjjCIQaXNftnpVyYHUE4icLQ4XbGAU/edit?pli=1
https://www.toptal.com/scala/why-should-i-learn-scala
https://contributors.scala-lang.org/t/what-can-make-scala-more-popular/2995
https://www.educative.io/blog/the-resurgence-of-scala-in-2019
https://hackernoon.com/10-reasons-to-learn-scala-and-functional-programming-2fce385e6ec7
https://stackoverflow.com/questions/15241903/what-can-i-do-in-scala-that-i-could-not-do-in-java
https://www.grahamlea.com/2013/02/a-new-java-library-for-amazing-productivity/
https://stackoverflow.com/tags/scala/info
- 点赞
- 收藏
- 关注作者
评论(0)