Search code examples
scalasbtdefaulttemporary-directory

How can I change the default sbt temporary directory?


SBT (the scala's interactive build tool) writes in Linux its temporary files in the /tmp directory. How can I change the default temporary directory?


Solution

  • What version of sbt are you using?

    I'm asking because of this PR: https://github.com/sbt/sbt/pull/5289, which was merged for sbt 1.4.0.

    I assume you are using an older version. If you have a reason to stick with the older version, consider setting the java.io.tmpdir system property.

    If you are already on 1.4.0 or newer, then you'll need to tell us what files you are seeing written to /tmp under what conditions, since the PR implies that shouldn't be happening.