CentOS Deployment Java Development environment

Source: Internet
Author: User

First, install the JDK

Jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u31-download-1501634.html

1.JDK uploading to Linux

[email protected] tools]# LL

Total 167060

-rw-r--r--1 root root 85292206 Nov 8 Jdk-6u31-linux-i586.bin

-rw-r--r--1 root root 85581913 Oct Jdk-6u31-linux-x64.bin

One is a 32-bit one is 64-bit, with 32-bit as an example

[Email protected] tools]# Mkdir/usr/local/java # #建立目录

[Email protected] tools]# MV jdk-6u31-linux-i586.bin/usr/local/java/

Move packages to/usr/local/java

[Email protected] tools]# cd/usr/local/java/

[Email protected] java]# chmod 777 Jdk-6u31-linux-i586.bin # #给安装包执行权限

[[email protected] java]#./jdk-6u31-linux-i586.bin # Installation succeeded when #安装出现Done

Setting environment variables

[Email protected] java]# Vim/etc/profile

Export java_home=/usr/local/java/jdk1.6.0_31

Export Classpath=.:%java_home%/lib/dt.jar:%java_home%/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

[Email protected] java]# Source/etc/profile

Verify that the Java installation is successful

[Email protected] java]# java-version

Java Version "1.6.0_31"

Java (TM) SE Runtime Environment (build 1.6.0_31-b04)

Java HotSpot (TM) Client VMs (build 20.6-b01, mixed mode, sharing)

[Email protected] java]# javac-version

Javac 1.6.0_31

Write a Java program under Run test

[[email protected] java]# javac helloworld.java 
 
Helloworld.java:2: Cannot find Symbol
&NBSP
symbol : Class string
 
Location:class HelloWorld
 
        public static void Main (string args[]) {
 
                                ^
 
Helloworld.java:3: Package system does not exist
 
&N Bsp               System.out.println ("Hello World");
 
                      ^
 
2 errors
&nbs P The
hints at 2 errors, and it's smart to see where it was written incorrectly.
 

Executing
 
[[email protected] java]# javac helloworld.java
 
[[Email protected] Java ]# ll
 
Total 83412
 
-rw-r--r--  1 root root      425 Oct one 19:46 helloworld.c Lass
 
-rw-r--r--  1 root root      109 Oct one 19:46 helloworld.java
 
Drwxr-xr-x root root    4096 Oct one 19:33 jdk1.6.0_31
 
-rwxrwxrwx  1 root root 85292206 nov& nbsp 8  jdk-6u31-linux-i586.bin
 
See generated. class file
 
[[email protected] java]# Java HelloWorld
 
Hello World
 
Then print it on the screen Hello World

Ii. installation of Tomcat

Tomcat:

[Email protected] java]# wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.26/bin/apache-tomcat-7.0.26.tar.gz

[Email protected] java]# tar zxf apache-tomcat-7.0.26.tar.gz

[Email protected] java]# Mkdir/usr/local/tomcat

[Email protected] java]# Cp-ar apache-tomcat-7.0.26/*/usr/local/tomcat/

[Email protected] java]# cd/usr/local/tomcat/bin/

[Email protected] java]# chmod 777 startup.sh

[Email protected] java]# chmod 777 catalina.sh

[Email protected] bin]#./startup.sh

Using catalina_base:/usr/local/tomcat

Using Catalina_home:/usr/local/tomcat

Using Catalina_tmpdir:/usr/local/tomcat/temp

Using Jre_home:/usr/local/java/jdk1.6.0_31

Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

View native IP

Enter http://192.168.1.29:8080/in the browser

Show Tomcat Main Page

CentOS Deployment Java Development environment

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.