1.复制文件到指定文件路径
cp -rf /home/leehongee/LeeHonGee/jdk1.7.0_45 /usr/lib/jvm
2.创建文件夹
mkdir jvm
3.修改环境变量
sudo gedit /etc/profile
添加
#set java environment
export JAVA_HOME=/usr/lib/jvm/java-7-sun
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
4.配置默认JDK版本
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300
执行代码
sudo update-alternatives --config java
5.测试
java -version
----安装 make--------------------------
sudo apt-get install automake
sudo apt-get install gcc
sudo apt-get install build-essential