How to specify which java version to use with sbt 0.12.4?
问题 How to specify which java version to use with sbt 0.12.4? I have java 7 and java 8 installed. Since sbt 0.12.4 does not support java 8 but tries to use it by default, I have to specify java version explicitly for sbt. I want to keep using java 8 as a default version of java for other things. 回答1: One way that works well for me is, using the sbt script from sbt-extras and add to the root of the project a file called .sbtopts with: -java-home /Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk