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

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?


回答1:


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.



来源:https://stackoverflow.com/questions/31319201/how-to-change-the-temporary-directory-in-jetty9

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!