catch32
catch32

Reputation: 18612

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:

enter image description here

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.

Upvotes: 1

Views: 1523

Answers (2)

tcat
tcat

Reputation: 361

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.

Upvotes: 0

Kai Sternad
Kai Sternad

Reputation: 22840

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.

Upvotes: 2

Related Questions