Scala on JDK9

937 views
Skip to first unread message

Grzegorz Kossakowski

unread,
Jan 20, 2015, 11:15:15 AM1/20/15
to scala-internals
Howdy!

There're some exciting things happening in JDK9 like their modularisation effort. They got a build (b45) released which includes modularised Java standard library. I gave it a spin to see if we get hit by it. Here's what I get with Scala 2.11.4:

$ scalac A.scala
error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:17)
at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:18)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:53)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:45)
at scala.reflect.internal.Mirrors$RootsBase.getModuleOrClass(Mirrors.scala:66)
at scala.reflect.internal.Mirrors$RootsBase.getClassByName(Mirrors.scala:102)
at scala.reflect.internal.Mirrors$RootsBase.getRequiredClass(Mirrors.scala:105)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass$lzycompute(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.ObjectClass(Definitions.scala:257)
at scala.reflect.internal.Definitions$DefinitionsClass.init(Definitions.scala:1387)
at scala.tools.nsc.Global$Run.<init>(Global.scala:1053)
at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
at scala.tools.nsc.MainClass.doCompile(Main.scala:23)
at scala.tools.nsc.Driver.process(Driver.scala:51)
at scala.tools.nsc.Driver.main(Driver.scala:64)
at scala.tools.nsc.Main.main(Main.scala)

I haven't dug into it any further. Are you guys following JDK9 developments?

--
Grzegorz Kossakowski
Scalac hacker at Typesafe
twitter: @gkossakowski

Adriaan Moors

unread,
Feb 3, 2015, 2:26:41 PM2/3/15
to scala-i...@googlegroups.com
On a related note, it sounds like we could start experimenting with the jrt file system provider on Java 8 (and Scala 2.12), accessing a Java 9 runtime.

---------- Forwarded message ----------
From: Alan Bateman <Alan.B...@oracle.com>
Date: Tue, Feb 3, 2015 at 12:17 AM
Subject: Re: module/bootclass troubles with jdk9
To: Martin Buchholz <mart...@google.com>, jigsa...@openjdk.java.net
Cc: Doug Lea <d...@cs.oswego.edu>

<snip>
We're still not in "module land" yet, there's a standard module system for JSR 376 to define and there will be JEP for the implementation too. So too early to be looking for options like -modulepath.

For tools that need to access the classes and resources in another runtime image then the proposal (in JEP 220) is the jrt file system provider. At this time, this works for a tool running on JDK 9 to access the contents of its own image, or a tool running on JDK 8 to access the contents of a target JDK 9 image. So far then javac, jdeps and rmic have been changed to use the file system API. We're not yet at the point where a tool running on a build of JDK 9 or JDK 10 can access the contents of different JDK 9 or JDK 10 build but we'll get there (in a few months I hope, there are a few issues to sort out first and a number of other big changes in this areas that are higher priority at the moment).

</snip>

--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Zaugg

unread,
Apr 25, 2016, 8:09:42 AM4/25/16
to scala-internals
I'll submit a PR to 2.12.x soon that lets scalac consume the JDK9 classpath, and started surveying the other changes in JDK 9 that we need to adapt to / could profit from. I'm tracking this all on https://github.com/scala/scala-dev/issues/139.

-jason

Reply all
Reply to author
Forward
0 new messages