1.安装相关依赖库
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev ccache
2.安装open JDK7
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk
3.安装open JDK8
sudo apt-get update
sudo apt-get install openjdk-8-jdk
4.设置环境变量
输入如下命令打开profile文件
$ sudo gedit /etc/profile
在文件末尾追加下面内容
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH={JAVA_HOME}/bin:$PATH
然后执行如下命令更新配置
source /etc/profile
输入
echo $JAVA_HOME
如果输出为openjdk字样表示配置正确
5.linux 内核编译时出现scripts/sign-file.c:23:30: fatal error: openssl/opensslv.h错误的解决办法
ubuntu下缺少了部分如下的组件,安装一下即可
sudo apt-get install libssl-dev