本文主要是介绍rk3288_android5.1__android4.4 jdk1.6和jdk1.7共存问题 ubuntu java7 The required version is: 1.7.x,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
jdk-7u5-linux-x64.tar.gz下载地址:http://pan.baidu.com/s/1hq8UmDe
1.将jdk-7u5-linux-x64.tar.gz拷贝到/usr/lib/jdk/目录下面,这里如果没有jdk文件夹,则创建该文件夹,命令:
sudo mkdir jdk //创建文件夹jdk
sudo cp -r ~/download/jdk-7u10-linux-x64.tar.gz /usr/lib/jdk/ //把下载的文件拷贝到新创建的目录下面
sudo tar -zxvg jdk-7u10-linux-x64.tar.gz //解压缩文件
2.设置环境变量,用gedit打开/etc/profile文件
sudo gedit /etc/profile
在文件的最后面增加:
export JAVA_HOME=/usr/lib/jdk/jdk1.7.0_76
export JRE_HOME=/usr/lib/jdk/jdk1.7.0_76/jre
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=$CLASSPATH:.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
$ sourse /etc/profile
3.将系统默认的jdk修改过来
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jdk/jdk1.7.0_76/bin/java 300
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jdk/jdk1.7.0_76/bin/javac 300
$ sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jdk/jdk1.7.0_76/bin/javah 300
$ sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jdk/jdk1.7.0_76/bin/javadoc 300
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
4.检测,输入java -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
#============start add java1.6 for rk3288_sdk5.1 {=====
export JAVA_HOME=/usr/lib/jdk6/jdk1.6.0_45
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
#============end add java1.6 for rk3288_sdk5.1 }=====
sudo update-alternatives --install /usr/bin/java java /usr/lib/jdk6/jdk1.6.0_45/bin/java 300sudo update-alternatives --install /usr/bin/java javac /usr/lib/jdk6/jdk1.6.0_45/bin/javac 300
sudo update-alternatives --install /usr/bin/java javah /usr/lib/jdk6/jdk1.6.0_45/bin/javah 300sudo update-alternatives --install /usr/bin/java javadoc /usr/lib/jdk6/jdk1.6.0_45/bin/javadoc 300
这篇关于rk3288_android5.1__android4.4 jdk1.6和jdk1.7共存问题 ubuntu java7 The required version is: 1.7.x的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!