English 中文(简体)
JAVA_OPTS 剖腹产中的综合症
原标题:JAVA_OPTS Syntax in catalina.bat

i am trying to increase tomcat memory by adding JAVA_OPTS in catalina.bat as follows:

rem   TITLE           (Optional) Specify the title of Tomcat window. The default
rem                   TITLE is Tomcat if it s not specified.
rem                   Example (all one line)
rem                   set TITLE=Tomcat.Cluster#1.Server#1 [%DATE% %TIME%]
rem
rem
rem
rem $Id: catalina.bat 1146096 2011-07-13 15:20:43Z markt $
rem ---------------------------------------------------------------------------

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 
-server -Xms1536m -Xmx1536m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m 
-XX:MaxPermSize=512m -XX:+DisableExplicitGC 
-XX:UseConcMarkSweepGC 
-XX:CMSPermGenSweepingEnabled 
-XX:CMSClassUnloadingEnabled"

但是,在管理启动或关闭文字时,正在跟踪计算机辅助器中的错误:

 JAVA_OPTS  is not recognized as an internal or external command,
operable program or batch file.
 -server  is not recognized as an internal or external command,
operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.

请告知为何我正在找他们。

最佳回答

Try:

set JAVA_OPTS=-Djava.awt.headless=true -Dfile.encoding=UTF-8 ^
-server -Xms1536m -Xmx1536m ^
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m ^
-XX:MaxPermSize=512m -XX:+DisableExplicitGC ^
-XX:+UseConcMarkSweepGC ^
-XX:+CMSClassUnloadingEnabled
  • You need to use the set command to set an environment variable.
  • If you want to split a command over multiple lines in a windows bat file you need to add a ^ (caret) at the end of each line.
  • No quotes necessary.
问题回答

在每个新行端清除空位。

JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8[ENTER]
-server -Xms1536m -Xmx1536m[ENTER]
...




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签