Configure the java environment in redhatlinux

Source: Internet
Author: User
Redhatlinux: configure the java environment-general Linux technology-Linux programming and kernel information. For details, refer to the following section. The following describes the environment configuration for java and jsp development.

1. Required Software (I installed)
Jdk-6-linux-i586.bin
Jakarta-tomcat-5.0.30.tar.gz
2 Installation Steps
Install jdk
1 jdk-6-linux-i586.bin
First check licence, then you can use the software "yes ".
Decompress the package and obtain the jdk1.6.0 folder.
I tested it in the/usr/java/folder.
(

Mkdri/usr/java
Mv jdk1.6.0/usr/java
)
2. Configure environment variables (root User)
Vi/etc/profile
Add the following code at the end
Export JAVA_HOME =/usr/java/jdk1.6.0
Export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH
This is started with the system. If you want to start it with a specific user
Vi. bashrc
Join
Export JAVA_HOME =/usr/java/jdk1.6.0
Export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar: $ CLASSPATH
Export PATH = $ JAVA_HOME/bin: $ PATH
In this way, you can enter java
Javac
Java-version
To test whether the configuration is successful.
Install and configure 3tomcat
Extract
Tar-xzvf jakarta-tomcat-5.0.30.tar.gz
Get folder jakarta-tomcat-5.0.30
Then music jakarta-tomcat-5.0.30/usr/java
Then configure the environment variables.
Vi/etc/profile
Add the following code
Export CATALINA_HOME =/usr/java/jakarta-tomcat-5.0.30
Export CATALINA_BASE =/usr/java/jakarta-tomcat-5.0.30
Export TOMCAT_HOME =/usr/java/jakarta-tomcat-5.0.30
You can also add the following code after vi. bashrc
4 copy the files under lib under/usr/java/jdk1.6.0 to common/lib under the/usr/java/jakarta-tomcat-5.0.30 directory
5. Run http: // localhost: 8080/to test it.

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.