JAVA_OPTS vs. CATALINA_OPTS

423 views
Skip to first unread message

Peter Matthew Eichman

unread,
Jun 20, 2016, 12:43:10 PM6/20/16
to fedor...@googlegroups.com
Hello all,

When running Fedora 4 on Tomcat, is there any difference between setting system properties via CATALINA_OPTS vs. JAVA_OPTS? We have been using CATALINA_OPTS on our systems, but I notice that all of the Fedora documentation uses JAVA_OPTS instead. Is that just to be servlet-container agnostic, or are there other benefits to using JAVA_OPTS?

Thanks,
-Peter

Esmé Cowles

unread,
Jun 20, 2016, 12:47:12 PM6/20/16
to fedor...@googlegroups.com
Peter-

Tomcat's catalina.sh says:

# CATALINA_OPTS (Optional) Java runtime options used when the "start",
# "run" or "debug" command is executed.
# Include here and not in JAVA_OPTS all options, that should
# only be used by Tomcat itself, not by the stop process,
# the version command etc.
# Examples are heap size, GC logging, JMX ports etc.

# JAVA_OPTS (Optional) Java runtime options used when any command
# is executed.
# Include here and not in CATALINA_OPTS all options, that
# should be used by Tomcat and also by the stop process,
# the version command etc.
# Most options should go into CATALINA_OPTS.

Based on that, I'd say using CATALINA_OPTS is probably the better practice for options related to starting Tomcat, but either should work most of the time. There are probably other Java tools that look for JAVA_OPTS (e.g., Maven might do this), so there might be some cases where JAVA_OPTS works but CATALINA_OPTS would only work for Tomcat.

-Esmé
> --
> You received this message because you are subscribed to the Google Groups "Fedora Tech" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fedora-tech...@googlegroups.com.
> To post to this group, send email to fedor...@googlegroups.com.
> Visit this group at https://groups.google.com/group/fedora-tech.
> For more options, visit https://groups.google.com/d/optout.

Peter Matthew Eichman

unread,
Jun 20, 2016, 1:06:48 PM6/20/16
to fedor...@googlegroups.com
Thanks Esmé. Given that, we will stick with using CATALINA_OPTS for our config until we encounter problems.

-Peter
Reply all
Reply to author
Forward
0 new messages