diff --git a/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala b/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala index f3245c1ea..2073da404 100644 --- a/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala +++ b/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala @@ -12,16 +12,21 @@ class ZincComponentCompilerSpec extends BridgeProviderSpecification { val scala2122 = "2.12.2" val scala2123 = "2.12.3" val scala2130M2 = "2.13.0-M2" + def isJava8: Boolean = sys.props("java.specification.version") == "1.8" val logger = ConsoleLogger() it should "compile the bridge for Scala 2.10.5 and 2.10.6" in { - IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2105) should exist) - IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2106) should exist) + if (isJava8) { + IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2105) should exist) + IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2106) should exist) + } else () } it should "compile the bridge for Scala 2.11.8 and 2.11.11" in { - IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2118) should exist) - IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala21111) should exist) + if (isJava8) { + IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2118) should exist) + IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala21111) should exist) + } else () } it should "compile the bridge for Scala 2.12.2" in {