Background: If Alfresco runs on a Windows server (in production) you want it to run as a service so that Alfresco is automatically started if the server is rebooted for some reason.
This describes how you set JAVA_OPTS for Alfresco as a Windows service.
- Open up the Windows services manager (Start… run… services.exe) and locate the Tomcat service for your Alfresco installation. (If started, shut down the service.)
- Double-click the service and look at the service name field and note the name. It should be something like ”alfrescoTomcat…”.
- Open up the [alfresco]tomcatbin folder
- Copy the file tomcat7w.exe to [name-of-service]w.exe, e.g. ”alfrescoTomcatw.exe”
- Right click on the new exe file and choose Run as administrator
- Goto the tab named Java
- Enter your JAVA_OPTS under Java Options, e.g:
- Important: Make sure to remove any spaces at the beginning and the end of the rows above, otherwise it can cause the service to stop working.
- Start the Alfresco service
An alternative way to set the JAVA_OPTS for the Tomcat Windows service:
If you don’t have a tomcat7w.exe or don’t want to use if for some reason, you can also modify the JAVA_OPTS for the service via registry keys.
- Go to Start… Run. Type: regedit.exe.
- Locate the folder HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > Apache Software Foundation > Procrun 2.0.
- Under Procrun you will see all your installed Tomcat instances. Pick the right one and open it.
- Under Parameters > Java, you have a key called Options. Double-click it and put your JAVA_OPTS there.
- There may also be DWORD registry keys for JvmMs and JvmMx. Theese correspond to -Xms and -Xmx so change them as well if they are present.