日期:2014-05-16  浏览次数:20694 次

Linux下java环境的搭建
一、安装jdk 我的版本是:jdk-6u10-linux-i586.rpm

安装jdk1.6安装包: rpm -ivh jdk-6u10-linux-i586.rpm
配置环境变量:
1,进入profile文件:vi/etc/profile
2,在文件中添加以下代码:
   export JAVA_HOME = /usr/usr/java/jdk1.6.0_10 --jdk安装目录
   export CALSSPATH = $JAVA_HOME/lib/*.*         --jar包所在目录
   export PATH = $PATH:$JAVA_HOME/bin            --bin目录
重启系统:reboot
测试安装结果:
   输入java回车:出现下面情况:

   java
Usage: java [-options] class [args...]
           (to execute a class)
   or java [-options] -jar jarfile [args...]
           (to execute a jar file)

where options include:
    -d32          use a 32-bit data model if available
(此处省略一些内容)
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
输入javac出现下面情况:
javac
Usage: javac <options> <source files>
where possible options include:
-g                         Generate all debugging info
-g:none                    Generate no debugging info
-g:{lines,vars,source}     Generate only some debugging info
-nowarn                    Generate no warnings
(此处省略一些内容)
-help                      Print a synopsis of standard options
-Akey[=value]              Options to pass to annotation processors
-X                         Print a synopsis of nonstandard options
-J<flag>                   Pass <flag> directly to the runtime system
说明安装成功!

二、安装tomcat
版本是:apache-tomcat-6.0.18.tar.gz
将安装包拷贝到/user/local下即可
然后直接解压:tar -zxvf - apache-tomcat-6.0.18.tar.gz
解压完后会有一个与安装包同名的目录
启动tomcat :进入到bin目录里:cd /usr/local/apache-tomcat-6.0.18/bin
输入:./startup.sh
出现:
Using CATALINA_BASE:   /usr/local/apache-tomcat-6.0.18
Using CATALINA_HOME:   /usr/local/apache-tomcat-6.0.18
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-6.0.18/temp
Using JRE_HOME:       /usr
启动成功!
代开IE输入:http://192.168.200.239:8080即可登录tomcat欢迎页面
我的虚拟机里的linux系统ip是:http://192.168.200.239,
可通过ifconfig查看系统ip
同样在/usr/local/apache-tomcat-6.0.18/bin 目录下
通过./shutdown.sh 关闭tomcat

三、安装mysql
安装包:MySQL-client-community-5.0.67-0.rhel4.i386.rpm
   MySQL-server-community-5.0.67-0.rhel4.i386.rpm

安装mysql数据库服务器:rpm -ivh --nodeps MySQL-server-community-5.0.67-0.rhel4.i386.rpm
安装过程出现以下内容:
warning: MySQL-server-community-5.0.67-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing...   &n