How is Tomcat temp directory located?

I run Tomcat bundled with Liferay5.2.3 and use Eclipse 3.5 (Galileo) as my IDE. I installed my Tomcat server in Eclipse according to this blog post: http://www.jroller.com/holy/entry/developing_portlets_for_liferay_in . If I run Tomcat through the Eclipse server configuration, Liferay / Tomcat uses my C: \ Documents and Settings \ user \ Local Settings \ Temp \ directory. However, if I run Tomcat directly using the startup.bat script, Liferay / Tomcat uses the Tomcat temporary directory. I cannot figure out whether Eclipse, Liferay or Tomcat will decide which temp directory to use or how to change it. I would prefer to use the Tomcat temporary directory.

I have this problem with Lifera / Tomcat 5.5 and 6.0 packages (liferay-portal-tomcat-6.0-5.2.3.zip and liferay-portal-tomcat-5.5-5.5.3.zip).

Does anyone have any clues?

+7
eclipse directory tomcat liferay temp
source share
3 answers

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

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

You can also go below as a VM argument while running Tomcat in Eclipse to use it as a temp directory.

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

Although I still don't know where / how Tomcat determines where the default temp directory should be, and I don’t know why Eclipse sets it to something else, I found that you can set the temp directory through the VM argument when running Tomcat in Eclipse:

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

+2
source share

In your workspace, you can find the following folder structure:

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

Here you will find the folder attached to tomcat in eclipse.

+1
source share

All Articles