Configure java environment variables in CentOS

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.