使用hadoop的时候,一直提示class找不到,
输入java -version
显示gij
必须删除gij,安装oracle的jdk
输入
rpm -qa | grep gcj
显示
libgcj-4.4.7-3.el6.x86_64
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
运行
yum remove java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
在/etc/profile添加
export JAVA_HOME=/usr/java/jdk1.7.0_75
export JRE_HOME=/usr/java/jdk1.7.0_75/jre
export CLASSPATH=.:${CLASSPATH}:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${PATH}:${JAVA_HOME}/bin:${JRE_HOME}/bin
# Set hadoop environment
export HADOOP_HOME=/opt/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export M2_HOME=/usr/java/maven
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
运行
java -version
java version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
一切ok
阅读(2213) | 评论(0) | 转发(0) |