CATALINA_OPTS v JAVA_OPTS - What is the difference?
2010-04-10 10:46
316 查看
There are two environment variables - CATALINA_OPTS and JAVA_OPTS -
which are both used in the catalina.sh startup and shutdown
script for Tomcat. They are described in comments within that file as:
(optional) Java runtime options used when the "start", "stop" or
"run" command is executed [JAVA_OPTS]
and
(optional) Java runtime options used when the "start" or "run"
command is executed [CATALINA_OPTS]
So why are there two different variables? And what's the
difference?
Firstly, anything specified in EITHER variable is passed, identically,
to the command that starts up Tomcat - the "start" or "run" command -
but only values set in JAVA_OPTS are passed to the "stop" command. That
probably doesn't make any difference to how Tomcat runs in practise as
it only effects the end of a run, not the start.
The second difference is more subtle. Other applications may also use
JAVA_OPTS, but only Tomcat will use CATALINA_OPTS. So if you're setting
environment variables for use only by Tomcat, you'll be best advised to
use CATALINA_OPTS, whereas if you're setting environment variables to be
used by other java applications as well, such as by JBoss, you should
put your settings in JAVA_OPTS.
which are both used in the catalina.sh startup and shutdown
script for Tomcat. They are described in comments within that file as:
(optional) Java runtime options used when the "start", "stop" or
"run" command is executed [JAVA_OPTS]
and
(optional) Java runtime options used when the "start" or "run"
command is executed [CATALINA_OPTS]
So why are there two different variables? And what's the
difference?
Firstly, anything specified in EITHER variable is passed, identically,
to the command that starts up Tomcat - the "start" or "run" command -
but only values set in JAVA_OPTS are passed to the "stop" command. That
probably doesn't make any difference to how Tomcat runs in practise as
it only effects the end of a run, not the start.
The second difference is more subtle. Other applications may also use
JAVA_OPTS, but only Tomcat will use CATALINA_OPTS. So if you're setting
environment variables for use only by Tomcat, you'll be best advised to
use CATALINA_OPTS, whereas if you're setting environment variables to be
used by other java applications as well, such as by JBoss, you should
put your settings in JAVA_OPTS.
相关文章推荐
- What is the difference between a soft reference and a weak reference in Java?
- Java-What is the difference between <? super E> and <? extends E>?
- Linux Kernel: What is the major difference between the buffer cache and the page cache?
- what is the difference between inner join and outer join
- What is the difference between XML and C or C ?
- android: what is the difference between focused, enabled, pressed, and selected states?
- What is the difference between a pack slip and a pick slip?
- what is the difference between zImage (kernel) and boot.img
- What is the difference between initWithCoder:, initWithNibName:, and awakeFromNib?
- What is the difference between a binary tree, a binary search tree, a B tree and a B+ tree?
- What is the difference between AWT and SWT?
- What is the difference between /dev/ttyUSB and /dev/ttyACM
- What is the difference between a theorem, a lemma, and a corollary?
- what is the difference between MirrorView, SanCopy, SanpSure and SnapView
- What Is the Difference Between a Block, a Proc, and a Lambda in Ruby
- What is the difference between primary & secondary storage device?
- What is the difference between a thread and a process?
- What is the difference between '/n' and '/r/n'? /n /r/n的区别是什么
- What is the difference between "green" threads and "native" threads?
- What is the difference between database table and database view?