简体   繁体   中英

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?

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.

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM