Setting up the Java EE Environment under Linux environment

Source: Internet
Author: User

One, JDK installation (installed in the/usr/java directory)
1. Download: Jdk-7-ea-bin-b26-linux-i586-24_apr_2008.bin
Address: Http://jx.newhua.com/down/jdk-7-ea-bin-b26-linux-i586-24_apr_2008.zip
Unzip the zip format under Windows Jdk-7-ea-bin-b26-linux-i586-24_apr_2008.bin
and upload it to the Linux server's/usr/java directory.
2. Add executable permissions to the file
[Email protected] java]# chmod x jdk-7-ea-bin-b26-linux-i586-24_apr_2008.bin
3. Executive Jdk-7-ea-bin-b26-linux-i586-24_apr_2008.bin
[Email protected] java]#./jdk-7-ea-bin-b26-linux-i586-24_apr_2008.bin
Automatically install the build directory jdk1.7.0
4. Configure Environment variables
There are three ways to configure environment variables (Modify the/etc/profile file, modify the. bashrc file under the user directory, and modify it directly under the shell). I modified the/etc/profile file:
[Email protected] java]# Vi/etc/profile
After opening the file, press the I key to add after the file:
java_home=/usr/java/jdk1.7.0
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar or.: $JAVA _home/jre/lib/rt.jar
Export Java_home PATH CLASSPATH (Configure global variables)
Press the ESC key
Input: Wq save exit.
Restarting the server
6. Test the configuration environment
Write a simple HelloWorld to test it.
[Email protected] java]# VI Helloworld.java
File, enter:
public class helloworld{
public static void Main (String args[]) {
System.out.println ("Hello World in linux!!");
}
}
: Wq Save Exit
[Email protected] java]# Javac Helloworld.java
No errors, Next:
[Email protected] java]# java HelloWorld

Second, Tomcat installation: (also installed in the/usr/java directory)

: http://mirror.vmmatrix.net/apache/tomcat/tomcat-5/v5.0.28/bin/jakarta-tomcat-5.0.28.tar.gz
1, unzip to/usr/ Java directory:
[[email protected] java]# tar-zxvf jakarta-tomcat-5.0.28.tar.gz
/usr/ A new directory will appear in the Java directory jakarta-tomcat-5.0.28
2, creating a file Link:
[[email protected] java]# ln-s jakarta-tomcat-5.0.28 Tomcat
3, configuration catalina_home:
[[email protected] java]# vi/etc/profile
Add at end of file
catalina_home=/usr/ Java/tomcat
Export catalina_home
: Wq Save exit
4, start tomcat:
input
[[email protected] tomcat]# bin/ startup.sh
or
[[email protected] tomcat]# bin/catalina.sh run

Close Tomcat by:
[[email protected] tomcat]# bin/catalina.sh stop
or [[email protected] tomcat]# bin/shutdown.sh
Shell output:
Using catalina_base:/usr/java/tomcat
Using Catalina_home:/usr/java/tomcat
Using Catalina_tmpdir:/usr/java/tomcat/temp
Using Java_home:/usr/java/jdk1.7.0
5, input in the browser (note: This refers to the Linux virtual machine on the machine, on non-Linux native browser access, to enter the Linux virtual machine IP address): http://localhost:8080 will appear tomcat welcome page
6. Managing Tomcat:
[Email protected] tomcat]# VI conf/tomcat-users.xml
Join in and between:
7. Restart the system:
Browser input: Http://localhost:8080/manager log in and you can manage it.
Enter http://localhost:8080/manager/html to manage your project.
Linux system does not open 8080 ports by default, open port 8080 can be:
[Email protected] ~]# cd/etc/sysconfig/
[Email protected] sysconfig]# VI iptables
Add this sentence:-a rh-firewall-1-input-m State--state new-m tcp-p TCP--dport 8080-j ACCEPT (different distributions have different wording)

Note: This blog post is only my study, the work of technical notes

Setting up the Java EE Environment under Linux environment

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.