Article Title: Configure java environment variables in CentOS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
We often use java in CentOS. However, many people may not know about it. Next, let's introduce this knowledge. It is mainly used to configure java environment variables in CentOS.
(1) Use a text editor to open/etc/profile in CentOS.
(2) Add the CentOS system to the end of the profile file:
JAVA_HOME =/usr/local/jdk1.5.0 _ 05
PATH = $ JAVA_HOME/bin: $ PATH
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME
Export PATH
Export CLASSPATH
(3) CentOS system restart
Ps replace javahome path
(4) When tomcat is started, it must be owned by bin. Sh File Execution permissions are added, not just startup, or so. Otherwise, the configuration item cannot be found.
(5) If you want to increase the VM memory used by tomcat, open catalina. sh and add
JAVA_OPTS = '-Xms256m-xmx1024m.
In win, set JAVA_OPTS =-Xms256m-Xmx512m (catalina. bat)
In this way, we have completed the configuration of java environment variables in the CentOS system.