先记录下安装jdk出现的问题:
(1)首先删除掉已经安装的openjdk
sudo apt-get purge openjdk*
Clean up the historical open jdk:
sudo apt-get purge openjdk*
Add a new repo and install the sdk:
sudo add-apt-repository ppa:eugenesan/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
If you want the JRE and the browser plugin:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
出现问题:
dpkg: error processing oracle-java7-installer (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up gsfonts-x11 (0.22) ...
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
解决方案:
1.$ sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old //现将info文件夹更名
2.$ sudo mkdir /var/lib/dpkg/info //再新建一个新的info文件夹
3.$ sudo apt-get update, apt-get -f install //不用解释了吧
4.$ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old //执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_old文件夹下
5.$ sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
6.$ sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info //把以前的info文件夹重新改回名字
参见:
http://jingyan.baidu.com/article/b2c186c8e95d1dc46ef6ff0c.html
结果还是不行!!!!!!!!!!
最后是这个最简单的方法:
Using Oracle Java 7 is not formally supported by Ubuntu. There’s plenty solutions for installing it, listed on https://help.ubuntu.com/community/Java .
The simplest one listed is this one:
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installerIt’ll keep your java 7 installation up to date.
To automatically set up the Java 7 environment variables JAVA_HOME and PATH:
sudo apt-get install oracle-java7-set-default
转自:http://www.kankanews.com/ICkengine/archives/111362.shtml
看来还是要直接找官网上的资料啊。。
配置JAVA环境变量:
sudo gedit /etc/environment
在其中添加如下两行:
JAVA_HOME=/usr/lib/jvm/java-7-oracle CLASSPATH=.:/usr/lib/jvm/java-7-oracle/lib
HADOOP的DATANODE启动失败:
http://blog.sina.com.cn/s/blog_4c248c5801014nd1.html
遇到了一个问题;
解决方案:close the firewall -----sudo ufw disable
原文地址:http://blog.csdn.net/yijichangkong/article/details/38622705