scala SBT和Java兼容性

a9wyjsp7  于 7个月前  发布在  Scala
关注(0)|答案(1)|浏览(89)

我已经下载了sbt-1.8.0,当我尝试运行sbt我收到错误:

\Downloads\sbt-1.8.0>sbt
[warn] Neither build.sbt nor a 'project' directory in the current directory: C:\Users\fff\Downloads\sbt-1.8.0
c) continue
q) quit
? c
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
The filename, directory name, or volume label syntax is incorrect.
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Java 11版本:

\Downloads\sbt-1.8.0>java -version
openjdk version "11.0.16.1" 2022-08-12
OpenJDK Runtime Environment Temurin-11.0.16.1+1 (build 11.0.16.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.16.1+1 (build 11.0.16.1+1, mixed mode)

我的理解是,MaxPermSize支持已经从Java版本8中删除了。Sbt1.8与Java 11不兼容吗?

w8ntj3qf

w8ntj3qf1#

我在我的项目中沿着了这个sbt版本和jdk1.8.0.171

:project/build.properties

sbt.version=0.13.17

但由于一些问题,我不得不更换我的笔记本电脑,并重新配置所有设置,然而,我在项目中的sbt版本是相同的,但我已经安装了一个升级的jdk jdk1.8.0.361这是造成这个问题。

build.properties
sbt.version=0.13.17

我重新安装了jdk1.8.0.171,现在它对我来说工作正常。

相关问题