linux 安装部署java

首先下载java: wget 

http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/jdk-6u21-linux-i586.bin?BundledLineItemUUID=JHiJ_hCwaK0AAAEqL4NXn9U2&OrderID=gWGJ_hCwaIoAAAEqH4NXn9U2&ProductID=LxaJ_hCy4mIAAAEpXLwzBGsB&FileName=/jdk-6u21-linux-i586.bin

先更改文件名 mv xxx to jdk-linux.bin

chmod 755  jdk-linux.bin

./ jdk-linux.bin

安装完成设置java环境变量:

export JAVA_HOME=“JDK目录"

export CLASSPATH=.:xxx/lib/dt.jar:xxx/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin

然后控制台打印java 会出来很多的信息

打印javac 来确定环境变量的设置

系统环境变量:.bush/profile 

java部署成功

配置
1.bash_profile 
export JAVA_HOME=/opt/jdk1.6.0_21
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_INSTALL=/opt/hadoop-0.18.3
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_INSTALL/bin
2.hadoop-env.sh
export JAVA_HOME=/opt/jdk1.6.0_21
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_INSTALL=/opt/hadoop-0.18.3
export PATH=$PATH:$HADOOP_INSTALL/bin

 

vi .bash_profile

配置
1.bash_profile 
export JAVA_HOME=/opt/jdk1.6.0_21
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_INSTALL=/opt/hadoop-0.18.3
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_INSTALL/bin
2.hadoop-env.sh
export JAVA_HOME=/opt/jdk1.6.0_21
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export HADOOP_INSTALL=/opt/hadoop-0.18.3
export PATH=$PATH:$HADOOP_INSTALL/bin
服务器需要重启
3.hadoop namenode -format 格式化
 /tmp/hadoop-root/dfs/name
4.启动守护进程
start-dfs.sh
start-mapred.sh
jobtracker http://localhost:50030 
namenode   http://localhost:50070

 

 

 

 

你可能感兴趣的:(java,jdk,linux,hadoop,bash)