Preliminary compatibility with JDK 9 #2951
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request cleans up two small issues that stood in the way of using the soon-to-be-released Java 9 with SBT.
java.ext.dirs
java.xml.bind
not part of thejava.base
default classpathScala compiler versions prior to 2.12.1 do not tolerate the absence of
rt.jar
from the JDK. But we can appease them a little manual setup.First, we can extract an equivalent JAR with a tool I've written:
Then, we can feed that to the compilation classpath of Scala compilers used within SBT with the
scala.ext.dirs
System property.Note that this doesn't actually require you to use Scala 2.12.1 in your application, 2.11.8 is able to use Java 9.
Also note that
scalac
does not yet enforce the stricter module accessibility rules imposed by JEP-261, so your code might typecheck and compile but incurLinkageError
-s at runtime if you are calling non-exported APIs.