Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24417 Build and Run Spark on JDK11
  3. SPARK-27121

Resolve Scala compiler failure for Java 9+ in REPL

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Spark Shell
    • None

    Description

      Currently under Java 11:

      SingletonReplSuite:
      [init] error: error while loading Object, Missing dependency 'object scala in compiler mirror', required by /modules/java.base/java/lang/Object.class
      
      Failed to initialize compiler: object scala in compiler mirror not found.
      ** Note that as of 2.8 scala does not assume use of the java classpath.
      ** For the old behavior pass -usejavacp to scala, or if using a Settings
      ** object programmatically, settings.usejavacp.value = true.
      
      Failed to initialize compiler: object scala in compiler mirror not found.
      ** Note that as of 2.8 scala does not assume use of the java classpath.
      ** For the old behavior pass -usejavacp to scala, or if using a Settings
      ** object programmatically, settings.usejavacp.value = true.
      org.apache.spark.repl.SingletonReplSuite *** ABORTED ***
        Exception encountered when invoking run on a nested suite - The code passed to eventually never returned normally. Attempted 110 times over 50.062409015 seconds. Last failure message: cond.apply() was false current output: Interpreter encountered errors during initialization!
        . (SingletonReplSuite.scala:92)
      ReplSuite:
      - propagation of local properties
      [init] error: error while loading Object, Missing dependency 'object scala in compiler mirror', required by /modules/java.base/java/lang/Object.class
      ...
      

      This is a fairly well-known issue with Scala and Java 9, though workarounds online don't seem to apply to the REPL. So far I do not think Scala promises compiler compatibility with Java 9+, and indeed that's why we compile with Java 8. However the REPL compiles on the fly.

      See for example https://github.com/sbt/sbt/issues/2958

      Attachments

        Issue Links

          Activity

            People

              srowen Sean R. Owen
              srowen Sean R. Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: