1、新建scala项目,报错。
搜索:sbt设置MaxPermSize
原因:
(1)https://www.douban.com/group/topic/45016729/
(2)https://www.douban.com/note/311383726/
参考解决方法:
https://www.cnblogs.com/30go/p/7909630.html
https://www.cnblogs.com/zeling/p/8494828.html
解决步骤:
(1)下载sbt1.1.6
(2)进入conf文件夹,修改sbtconfig.txt(注意配置的路径关联):
# Set the java args to high
-Xmx1024M
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
# Set the extra SBT options
-Dsbt.log.format=true
-Dsbt.boot.directory=F:/sbt-1.1.6/data/.sbt/boot
-Dsbt.global.base=F:/sbt-1.1.6/data/.sbt
-Dsbt.ivy.home=F:/sbt-1.1.6/data/.ivy2
-Dsbt.repository.config=F:/sbt-1.1.6/conf/repo.properties
(3)在conf中新建repo.properties:
[repositories]
local
aliyun: http://maven.aliyun.com/nexus/content/groups/public/
typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-oss-releases
maven-central
sonatype-oss-snapshots
(4)打开cmd,输入sbt,如果出现类似下面的结果则表明安装成功:
C:\Users\PetterChen>sbt
“C:\Users\PetterChen.sbt\preloaded\org.scala-sbt\sbt\”1.0.3”\jars\sbt.jar”
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[info] Loading project definition from C:\Users\PetterChen\project
[info] Set current project to petterchen (in build file:/C:/Users/PetterChen/)
[info] sbt server started at 127.0.0.1:4729
sbt:petterchen>
(5)最后在idea配置sbt的sbt-launch.jar路径。