sbt, the interactive build tool
Go to file
Dream 28d877f633
[2.x] fix: Runner should fail on JDK < 17 for sbt 2.x (#8825)
**Problem**
Running sbt 2.x with JDK 8 produces a confusing "server was not
detected" error because the JDK version check only required JDK 8+
and only ran in the non-native-client path.

**Solution**
Move java_version detection before the native client decision and add
checkJava17ForSbt2 that requires JDK 17+ when sbt major version >= 2.

Fixes #8813

* [2.x] fix: Fail early when sbt 2.x is run with JDK < 17 (sbtw)

Move JDK version check before native client decision in sbtw and
require JDK 17+ when build.properties declares sbt 2.x.

* [2.x] fix: Fail early when sbt 2.x is run with JDK < 17 (sbt.bat)

Move checkjava before native client decision in sbt.bat and require
JDK 17+ when build.properties declares sbt 2.x.

* [2.x] test: Add minimumJdkVersion helper and unit tests for sbtw

Extract JDK version check logic into Runner.minimumJdkVersion for
testability. Add RunnerSpec with tests for sbt 1.x, 2.x, and 3.x
version detection.

* [2.x] test: Bump fake java to JDK 17 for integration tests

The fake java script used by launcher integration tests reported
JDK 8. Since sbt 2.x now requires JDK 17+, the citest2 (sbt 2.x)
integration tests would fail with the new JDK version check.

* Simulate JDK 9+ rt.jar handling in fake java script

Instead of silently ignoring --rt-ext-dir (which causes sbt.bat
to mkdir on an empty string), properly simulate JDK 9+ behavior
by creating a temp directory with java9-rt-ext- prefix and a
dummy rt.jar inside it.
2026-02-27 11:43:24 -05:00
.github [2.x] feat: repositories_force support (#8761) 2026-02-20 01:52:59 -05:00
buildfile/src [2.x] Fix lazy val name handling in Eval (#8818) 2026-02-26 10:57:27 -05:00
client Revert "[2.x] feat: Enable musl static linking for sbtn on JDK 17+ (#8464)" (#8557) 2026-01-16 00:06:28 -05:00
contributing-docs Scala 3.8.2 (#8805) 2026-02-24 00:29:44 -05:00
core-macros/src [2.x] fix: Reject java.io.File as cached task output type (#8766) 2026-02-21 01:35:46 -05:00
internal [2.x] fix: sbt -debug doesn't display loading log (#8819) 2026-02-26 13:50:31 -05:00
launch [2.x] feat: repositories_force support (#8761) 2026-02-20 01:52:59 -05:00
launcher-package [2.x] fix: Runner should fail on JDK < 17 for sbt 2.x (#8825) 2026-02-27 11:43:24 -05:00
licenses move remaining pieces of sbt subproject to sbt_pending and fix notices 2010-09-21 21:55:50 -04:00
lm-core [2.x] perf: lightweight UpdateReport cache persistence (#8815) 2026-02-25 22:36:07 -05:00
lm-coursier [2.x] fix: excluding artifacts w/o scala version suffix (#7454) (#8756) 2026-02-25 15:06:16 -05:00
lm-ivy/src [2.x] fix: excluding artifacts w/o scala version suffix (#7454) (#8756) 2026-02-25 15:06:16 -05:00
main [2.x] feat: Support doc / skip := true (#8824) 2026-02-27 08:41:04 -05:00
main-actions/src [2.x] fix: Fixes explicitlySpecified and selectors for testOnly (#8727) 2026-02-13 09:19:05 -08:00
main-command/src [2.x] fix: Print server stderr on startup failure (#8816) 2026-02-26 00:31:09 -05:00
main-settings/src [2.x] fix: Fixes plugin toggle precedence between disablePlugins and enablePlugins (#8794) 2026-02-23 00:11:57 -05:00
notes Spelling (#8028) 2025-02-04 01:11:28 -05:00
project Scala 3.8.2 (#8805) 2026-02-24 00:29:44 -05:00
protocol/src [2.x] feat: sbtn subscription level (#8796) 2026-02-24 21:46:37 -05:00
run [2.x] fix: Fixes double quotes handling in fork mode (#8765) 2026-02-24 23:22:48 -05:00
sbt-app/src [2.x] feat: Support doc / skip := true (#8824) 2026-02-27 08:41:04 -05:00
sbt-remote-cache/src/main/scala/sbt remove unnecessary `case` 2025-02-22 08:48:29 +09:00
sbtw [2.x] fix: Runner should fail on JDK < 17 for sbt 2.x (#8825) 2026-02-27 11:43:24 -05:00
scripted-sbt [2.x] Add project id to Zinc debug log (#8750) 2026-02-24 21:55:39 -05:00
scripts Fix lm-coursier scripted 2024-10-11 14:30:55 +02:00
server-test/src [2.x] feat: sbtn subscription level (#8796) 2026-02-24 21:46:37 -05:00
src [2.x] Add scripted test for #7838 (#8541) 2026-01-20 12:13:27 -05:00
tasks Use enum instead of scala.Enumeration in sbt.Execute.State (#8788) 2026-02-22 22:21:29 -05:00
tasks-standard Use SAM-conversion if possible (#8477) 2026-01-11 07:21:28 -05:00
testing [2.x] fix: Fixes testing EventHandler race condition 2026-02-09 10:55:06 -05:00
util-cache Fix ActionCache: treat invalid/empty JSON as cache miss 2026-02-15 07:50:38 +01:00
util-collection [2.x] refactor: Remove unnecessary asInstanceOf (#8791) 2026-02-22 23:46:21 -05:00
util-tracking [2.x] test: Migrate TrackedSpec.scala to verify.BasicTestSuite (#8547) 2026-01-15 22:51:29 -05:00
worker/src Fix raw types in java file (#8782) 2026-02-22 14:32:52 -05:00
zinc-lm-integration/src [2.x] Fix duplicate compiler bridge jar in ZincComponentManager (#8800) 2026-02-26 23:58:33 -05:00
.git-blame-ignore-revs [2.x] blame ignore commits (#8814) 2026-02-25 10:51:21 -05:00
.gitattributes Fix line endings in msi 2021-11-19 20:41:39 -05:00
.gitignore [2.x] fix : BSP compile returns StatusCode.Error on failure (#8104) (#8709) 2026-02-07 11:01:49 -05:00
.gitmodules Move metadata to lm-coursier/metadata 2024-10-09 09:44:42 +02:00
.java-version Scala 3.8.0 2026-01-24 04:52:28 -05:00
.jvmopts Add .jvmopts 2023-11-25 01:06:30 -05:00
.mailmap Add mailmap 2019-06-11 09:30:14 +02:00
.sbtopts Restore .sbtopts file 2020-11-19 12:42:26 -08:00
.scala-steward.conf Pin slf4j-api 2023-01-02 22:06:46 -05:00
.scalafmt.conf update scalafmt config. re-format build files 2025-09-23 10:28:38 +09:00
AGENTS.md [2.x] docs: Move to CONTRIBUTING (#8629) 2026-01-25 15:48:09 -05:00
CONTRIBUTING.md Update contributing to clarify AI usages (#8657) 2026-01-29 11:56:45 -05:00
LICENSE add LICENSE file 2023-06-25 09:53:06 +09:00
NOTICE Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
PROFILING.md docs: Update flamegraph guide --lines 2025-11-09 18:06:13 -05:00
README.md [2.x] docs: Move to CONTRIBUTING (#8629) 2026-01-25 15:48:09 -05:00
SUPPORT.md Transfer copyright to Scala Center 2023-06-20 16:39:07 +02:00
build.sbt [2.x] fix: Runner should fail on JDK < 17 for sbt 2.x (#8825) 2026-02-27 11:43:24 -05:00
reset.sh 1.0.3-SNAPSHOT 2017-09-16 15:52:58 -04:00
sbt [2.x] fix: Runner should fail on JDK < 17 for sbt 2.x (#8825) 2026-02-27 11:43:24 -05:00
sbt-allsources.sh Merge remote-tracking branch 'lm/wip/sbt-2.x' into 2.x-lm-coursier 2024-10-09 08:50:03 +02:00
sbt.sh Implement sbt-launch.jar download 2021-04-19 23:43:15 -04:00
server.md setting query is "sbt/setting" 2017-10-03 01:45:06 -04:00

README.md

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 2.x

This is the 2.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/zinc hosts Zinc, an incremental compiler for Scala.
  • sbt/sbt, this repository hosts modules that implement 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 or a pull request.

If you're looking for an idea for a contribution, issues labeled with good first issue or help wanted might be good starting points.

If you would like to ask questions about sbt, there's sbt channel on Scala Discord, but it would be good to gather questions on Stackoverflow.

license

See LICENSE.