How is the Tomcat temp directory location defined?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 10:36:22
dpinya

When you start Tomcat with catalina.sh (or catalina.bat), the temp directory is set with the CATALINA_TMPDIR variable:

if [ -z "$CATALINA_TMPDIR" ] ; then
# Define the java.io.tmpdir to use for Catalina
    CATALINA_TMPDIR="$CATALINA_BASE"/temp
fi

Also you can pass below as VM argument while starting Tomcat in Eclipse to use it as temp directory.

-Djava.io.tmpdir="C:\Program Files\liferay-portal-5.2.3-tomcat-6.0\tomcat-6.0.18\temp"

Although I still don't know where/how Tomcat determines where the default temp directory should be, nor do I know why Eclipse sets it to something different, I have found out that you can set the temp directory via a VM argument when starting Tomcat in Eclipse:

-Djava.io.tmpdir="C:\Program Files\liferay-portal-5.2.3-tomcat-6.0\tomcat-6.0.18\temp"

Narendra Shah

You can find the following folder structure in your workspace:

.metadata.plugins\org.eclipse.wst.server.core\tmp0\

Here you will find the folder which is attached with tomcat in eclipse.

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