简体   繁体   中英

How to change the temporary directory in jetty9?

I want to make a temp directory for my jetty and change the default /tmp directory to mine temp directory, I tried this

java -Djava.io.tmpdir=/home/jetty/temp

When I want to start my jetty and it worked, but I'm looking for a way to change the temp directory once and for all. Is there any configuration or xml or something that I can change?

Are you wanting to change the working directory for your webapp? or the overall temp directory for all processes that might be running under Jetty?

For the webapp specific case, see the prior answer about changing the temp directory for webapps .

For all processes in jetty, add the following 2 lines to your ${jetty.base}/start.ini

--exec
-Djava.io.tmpdir=/home/jetty/temp

Note: this will cause jetty-dist/start.jar to fork a new process for Jetty server.

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