Skip to content

SBT fails to start on the latest JDK-21 builds since build 21 (2023/5/4) #7235

@plokhotnyuk

Description

@plokhotnyuk

steps

  1. Download and extract jdk-21-ea to /usr/lib/jvm/jdk-21
  2. Run sbt -java-home /usr/lib/jvm/jdk-21

problem

The sbt fails to start with the following error:

[info] [launcher] getting org.scala-sbt sbt 1.9.0-RC1  (this may take some time)...
[info] welcome to sbt 1.9.0-RC1 (Oracle Corporation Java 21-ea)
error:
  bad constant pool index: 0 at pos: 47919
     while compiling: <no file>
        during phase: globalPhase=<no phase>, enteringPhase=<some phase>
     library version: version 2.12.17
    compiler version: version 2.12.17
  reconstructed args: -classpath /home/andriy/.sbt/boot/scala-2.12.17/lib/scala-library.jar -Yrangepos

  last tree to typer: EmptyTree
       tree position: <unknown>
            tree tpe: <notype>
              symbol: null
           call site: <none> in <none>
...

expectation

Normal start

notes

  • Reproducible on both sbt versions 1.8.2 and 1.9.0-RC1
  • Works fine with older jdk-21 builds (build 20 or older)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions