How to change the temporary directory in jetty9?

巧了我就是萌 提交于 2020-01-17 09:01:48


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


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


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