Heitor Barbieri
Heitor Barbieri

Reputation: 159

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?

Upvotes: 1

Views: 929

Answers (2)

Yevhen Krotov
Yevhen Krotov

Reputation: 1

Linux/Mac

mkdir /home/user/temp
export JAVA_OPTS="-Djava.io.tmpdir=/home/user/temp"

Dockerfile

RUN mkdir /home/user/temp
ENV JAVA_OPTS="-Djava.io.tmpdir=/home/user/temp"

Upvotes: 0

Seth Tisue
Seth Tisue

Reputation: 30498

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.

Upvotes: 2

Related Questions