Getting Started with ThingWorx > Installing and Upgrading ThingWorx > Windows Installation > PostgreSQL > Install Java and Apache Tomcat (Windows)
  
Install Java and Apache Tomcat (Windows)
1. Download and install the required version of the Java JDK from the Oracle website.
* 
Refer to the System Requirements document for version requirements.
2. Visit the Tomcat website to download the 32-bit/64-bit Windows Service Installer (pgp, sha1, sha512).
* 
Refer to the System Requirements document for version requirements.
* 
Best practice includes verifying the integrity of the Tomcat file by using the signatures or checksums for each release. Refer to Apache’s documentation for more information.
3. The Apache Tomcat Setup Wizard launches. Click Next.
4. Click I Agree.
5. In the Choose Components section, use the default settings. Click Next.
6. In the HTTP/1.1 Connector Port field, type 80 (or other available port).
7. In the Tomcat Administrator Login fields, enter a Tomcat user name and a unique, secure password for Tomcat administration.
* 
Although setting a Tomcat Administrator Login is shown as optional, it is required for use with ThingWorx.
8. Click Next.
9. Click Next.
10. Click Install.
11. Click Finish.
12. Launch Tomcat. Click Configure Tomcat. In the Configure Tomcat window, click the Java tab.
13. In the Java Options field, add the following to the end of the options field:
-Dserver -Dd64
-XX:+UseG1GC
-Dfile.encoding=UTF-8
-Djava.library.path=<path to Tomcat>\webapps\Thingworx\WEB-INF\extensions
* 
Djava.library.path example:
-Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat8.5\webapps\
Thingworx\WEB-INF\extensions
* 
For more information on these options and for additional options for hosted and/or public-facing environments, refer to the Apache Tomcat Java Option Settings.
14. Clear any values in the Initial memory pool and Maximum memory pool fields.
15. Click OK
16. In the location of the Tomcat installation, open CATALINA_HOME/conf/web.xml. Replace the default error page (default is stacktrace) by adding the following into the web.xml file. Place the following within the web-app tag (after the welcome-file-list tag ). A well-configured web application will override this default in CATALINA_HOME/webapps/APP_NAME/WEB-INF/web.xml so it won't cause problems.
<error-page><exception-type>java.lang.Throwable</exception-type><location>/error.jsp</location></error-page>
17. Remove all Tomcat example apps located in /<path_to_tomcat>/webapps/examples/.
* 
These apps should be removed to prevent unnecessary access to Tomcat, specifically in the context that would allow users to view other users cookies.
18. (OPTIONAL STEP) To increase the default cache settings that affect static file caching, add the following line within the <context></context> tags in the $CATALINA_HOME/conf/context.xml file:
<Resources cacheMaxSize="501200" cacheObjectMaxSize="2048" cacheTtl="60000"/>
* 
Increasing this setting improves performance and avoids the following message in Tomcat:
WARNING: Unable to add the resource at [/Common/jquery/jquery-ui.js] to the cache
because there was insufficient
free space available after evicting expired cache entries -
consider increasing the maximum size of the cache
19. For H2/Azure SQL ONLY: Go to Install ThingWorx.
20. For POSTGRESQL ONLY: Go to Install and Configure PostgreSQL.