简体   繁体   中英

can't import sbt project with JDK 1.8?

I want to import sbt project under Intellij 13.1.

Current java version:

nazar@lelyak-desktop:~⟫ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)

During building project, I got error message:

在此处输入图片说明

Something is wrong with JDK 1.8?

I can't finish importing the project.

UPDATE:

I solved it by moving again to 1.7 version. It works fine.

Here is few tips about this issue Cannot build with sbt

Any suggestions.

Looks like your SBT uses a Scala version that isn't compatible with Java 8 . Try updating your SBT / Scala to a newer version and it should work again.

I'm using sbt version 0.13.7 on Mac OS 10.10.2 with Java 1.8. I ran into the same problem and solved it with setting the 'java-home' option for sbt in the /usr/local/etc/sbtopts file. Specifically, I added this line to /usr/local/etc/sbtopts:

-java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home

I did not need to change any sbt startup script or anything else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM