Legacy Knowledge Base
Published Sep. 10, 2025

How do I change Tomcat's temp folder path to another?

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • How can the Tomcat temp folder path be changed to a different path?

Environment

  • Liferay DXP 7.3

Resolution

  • In order to configure Tomcat to use a different temp directory, users must first understand the java.io.tmpdir parameter value, which is currently set to$CATALINA BASE/tempin Tomcat.
    They can modify it by setting the $CATALINA TMPDIR environment variable before running Tomcat's startup.sh
    From catalina.sh:
    # CATALINA_TMPDIR (Optional) Directory path location of temporary directory
    # the JVM should use (java.io.tmpdir). Defaults to
    # $CATALINA_BASE/temp.
  • The steps that were taken to achieve the expected behavior of the temp folder in the specified path are as follows:
    1) Stopped the Liferay application
    2) Navigated to {liferay_home}\tomcat-9.0.53\bin (local test machine: Windows)
    3) Opened catalina.bat and modified the CATALINA_TMPDIR in this file
    if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
    set "CATALINA_TMPDIR=%D:\DXP7.3\DXP7.3\liferay-dxp-7.3%\temp"
    :gotTmpdir
    Previous was:
    if not "%CATALINA_TMPDIR%" == "" goto gotTmpdir
    set "CATALINA_TMPDIR=%CATALINA_BASE%\temp"
    :gotTmpdir
    4) Cleared all temp folders and restarted the application.

Additional Information

*Unofficial articles are those that are not provided by Liferay but rather are found online while conducting research for a specific situation
Did this article resolve your issue ?

Legacy Knowledge Base