转自:https://web.liferay.com/de/community/wiki/-/wiki/Main/Eclipse+Debugging+Liferay+on+Tomcat#section-Eclipse+Debugging+Liferay+on+Tomcat-(Older+versions)+With+a+straightforward+launch+configuration
Using a Launch Configuration specifically created to run Tomcat directly, bypassing Eclipse.
- Open "Run Configurations..." under the Run button
- Under Java Applications node in the tree, right click and "New"
- On Main tab, select the portal source code project or your EXT project
- In the Main class put org.apache.catalina.startup.Bootstrap, don't check any check boxes
- Go to Arguments tab, in the Program arguments type: start
- In VM arguments put like:
这里的参数
-Xmx2600M
-XX:PermSize=128M
-XX:MaxPermSize=512M
-Xmx512m -XX:PermSize=32m -XX:MaxPermSize=160m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config=${tomcat-root-folder}/conf/jaas.config -Dcatalina.base=${tomcat-root-folder} -Dcatalina.home=${tomcat-root-folder} -Djava.io.tmpdir=${tomcat-root-folder}/temp
Optional If you want to retain the tomcat logging settings include the following arguments.
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=${tomcat-root-folder}/conf/logging.properties
Change ${tomcat-root-folder} to point at your tomcat deployment root folder
- In the Working directory, make it: Other: ${tomcat-root-folder}/bin. Again, change ${tomcat-root-folder} accordingly
- In Classpath tab, remove ALL User entries, do NOT remove the JRE System library
- Select User Entries and "Add External JArs", find the bootstrap.jar file from the ${tomcat-root-folder}/bin folder and add only that one
- In the Source tab, select any related project, but also the main project. For example, if you want to also debug a plugin, add it's source path here
- Under Common tab check Run and Debug
- Apply all changes
- Now whenever you want to debug, just go to the debug button/drop down and click. The server should startup on console.