如何将JVM参数添加到Tomcat?

时间:2022-05-18 17:20:19

I am using Tomcat 7 and I want to add the following JVM argument:

我正在使用Tomcat 7,我想添加以下JVM参数:

-Xbootclasspath/p:PrintServiceFixer.jar

I added the aforementioned JVM argument in the tomcat windows application but it didn't work. I received the following error message:

我在tomcat windows应用程序中添加了前面提到的JVM参数,但它没有用。我收到以下错误消息:

WARNING: Bootstrap: command "-Xbootclasspath/p:/Path to Jar file/PrintServiceFixer.jar" does not exist.

警告:Bootstrap:命令“-Xbootclasspath / p:/ Jar文件/ PrintServiceFixer.jar的路径”不存在。

Why isn't this working?

为什么这不起作用?

SOLUTION: I added Startup VM parameter "-Xbootclasspath/p:C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\PrintServiceFixer.jar" to Tomcat 7 from tomcats windows application and it works now.

解决方案:我从tomcats windows应用程序向Tomcat 7添加了启动VM参数“-Xbootclasspath / p:C:\ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ lib \ PrintServiceFixer.jar”,现在可以使用了。

如何将JVM参数添加到Tomcat?

1 个解决方案

#1


You provided simple value

你提供了简单的价值

-Xbootclasspath/p:PrintServiceFixer.jar

Are you sure that PrintServiceFixer.jar is in the home directory of Tomcat? Where is this home directory?

您确定PrintServiceFixer.jar位于Tomcat的主目录中吗?这个主目录在哪里?

To be sure and avoid misunderstanding better provide full pathname to your jar file. Something like

为了确保并避免误解,请更好地提供jar文件的完整路径名。就像是

-Xbootclasspath/p:/etc/allJars/PrintServiceFixer.jar

This boot class path may contain multiple jars and directories where classes reside. Just use full path name to the each jar or location.

此引导类路径可能包含多个类所在的jar和目录。只需对每个jar或位置使用完整路径名称。

#1


You provided simple value

你提供了简单的价值

-Xbootclasspath/p:PrintServiceFixer.jar

Are you sure that PrintServiceFixer.jar is in the home directory of Tomcat? Where is this home directory?

您确定PrintServiceFixer.jar位于Tomcat的主目录中吗?这个主目录在哪里?

To be sure and avoid misunderstanding better provide full pathname to your jar file. Something like

为了确保并避免误解,请更好地提供jar文件的完整路径名。就像是

-Xbootclasspath/p:/etc/allJars/PrintServiceFixer.jar

This boot class path may contain multiple jars and directories where classes reside. Just use full path name to the each jar or location.

此引导类路径可能包含多个类所在的jar和目录。只需对每个jar或位置使用完整路径名称。