BrianHotoppandClaude Fable 5 cb90a47ce8 [1.x] fix: Delegate JDK platform classes to the platform loader in console (#9327)
The console/consoleQuick REPL loader rejects JDK platform-module
classes: ClasspathFilter's post-check refuses classes whose code
source is a jrt: URL, so a top-down REPL reference to java.sql.* falls
through to the REPL's own classloader, which finds the bytes in the
runner-generated java9-rt-ext jar (via scala.ext.dirs) and dies in
defineClass:

  java.lang.SecurityException: Prohibited package name: java.sql

Wrap the REPL parent loader with a fallback that consults
ClassLoader.getPlatformClassLoader (reflectively; absent on JDK 8,
which has no platform loader) only after the existing chain misses,
so project classes keep winning and platform classes resolve instead
of being redefined. Linkage through the classpath loader (a JDBC
driver implementing java.sql.Driver) was already sound: the launcher's
topLoader delegates to the platform loader on JDK 9+; only the
top-down path through ClasspathFilter was broken.

Verified against sbt 1.11.7 (fails) and a patched 1.12.3-SNAPSHOT
(passes) with the original report's repro: java.sql.Timestamp,
a project class extending it, and DriverManager.getConnection with
the postgresql driver, which now reaches the network layer.

The console/* scripted group is added to CI; it was not in any
scripted glob, so the new test (and the pre-existing
console/project-compiler-bridge) never ran.

Fixes #4328 (still reproducible on 1.11.7 before this change).

Co-authored-by: Claude Fable 5 <[email protected]>
2026-06-13 01:54:58 -04:00
2024-11-07 18:46:04 -08:00
2026-03-04 01:36:53 -05:00
2023-06-20 16:39:07 +02:00
2025-08-24 03:58:13 -04:00
2023-06-24 20:05:52 +09:00
2023-07-23 01:01:23 -04:00
2019-09-04 01:24:08 -04:00
2023-06-25 08:04:17 +09:00
2023-06-25 08:57:41 +09:00
2024-10-18 02:26:58 -04:00
2021-11-19 20:41:39 -05:00
2025-08-23 18:14:10 -04:00
2019-06-11 09:30:14 +02:00
2020-11-19 12:42:26 -08:00
2023-06-20 16:39:07 +02:00
2023-06-20 16:39:07 +02:00
2018-07-08 22:18:57 +09:00
2022-07-04 11:11:49 -04:00
2017-09-16 15:52:58 -04:00
2026-05-02 16:29:03 -04:00
2020-11-14 14:23:48 -05:00
2021-04-19 23:43:15 -04:00
2017-10-03 01:45:06 -04:00
2023-06-20 16:39:07 +02:00

CI Latest version Discord

sbt

sbt is a build tool for Scala, Java, and more.

For general documentation, see https://www.scala-sbt.org/.

sbt 1.x

This is the 1.x series of sbt. The source code of sbt is split across several GitHub repositories, including this one.

  • sbt/io hosts sbt.io module.
  • sbt/librarymanagement hosts sbt.librarymanagement module that wraps Ivy.
  • sbt/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implements the build tool.
  • Setup: Describes getting started with the latest binary release.
  • FAQ: Explains how to get help and more.
  • sbt/sbt-zero-seven: hosts sbt 0.7.7 and earlier versions

Issues and Pull Requests

Please read CONTRIBUTING carefully before opening a GitHub Issue.

The short version: try searching or asking on StackOverflow.

license

See LICENSE.

S
Description
sbt, the interactive build tool
Readme
97 MiB
Languages
Scala 94.5%
Java 3.1%
Shell 1.1%
Batchfile 0.9%
Roff 0.2%
Other 0.1%