1.jdk
#chmod u+x j2sdk-1_4_2-linux-i586-rpm.bin
#./j2sdk-1_4_2-linux-i586-rpm.bin
#rpm -ivh j2sdk-1_4_2-linux-i586-rpm
#cd /usr/java/
#ln -s j2sdk1.4.2/ jdk/
vi /etc/profile
在该配置文件最后加这样几行:
export JAVA_HOME=/usr/local/java/jdk
export CLASSPATH=.:/usr/local/java/jdk/lib/dt.jar:/usr/local/java/jdk/lib/tools.jar
export PATH=/usr/local/java/jdk/bin:$PATH
然后存盘退出,执行:
source /etc/profile
检验一下:
[IMGA][root@scientific bin]# java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
[root@scientific bin]#[/IMGA]
2.tomcat5.0.9
#tar zxvf jakarta-tomcat-5.0.29.tar.gz
#cp jakarta-tomcat-5.0.29.tar.gz /usr/local/tomcat
vi /etc/profile
在配置文件最后加入:
export CATALINA_HOME=/usr/local/tomcat
存盘退出,然后:source /etc/profile
启动Tomcat:/usr/local/tomcat/bin/startup.sh
使配置的环境变量立即生效。
文章评论