红联Linux门户
Linux帮助

讯为开发板:32位ubuntu16.4安装Android_JDK遇到的问题

发布时间:2016-12-09 11:17:20来源:linux网站作者:微尘hjx
买了一块讯为的开发板,这几天在做环境的搭建。讯为提供搭建环境的资料很少,如果使用他们提供的Ubuntu12.04.2平台应该就没什么问题了。
在执行脚本install-sun-java6.sh时出现一些问题。
 
这个他们提供的脚本里的内容:
#!/bin/sh  
#  
# Download Sun JDK 6 from:  
# http://www.oracle.com/technetwork/java/javase/downloads/index.html  
# Java SE Development Kit 6 Update 43  
#  
# You can download it by browser  
# http://download.oracle.com/otn-pub/java/jdk/6u43-b01/jdk-6u43-linux-x64.bin  
# wget doesn't work  
#   
chmod +x jdk-6u43-linux-x64.bin  
./jdk-6u43-linux-x64.bin  
mkdir -p /usr/lib/jvm  
mv jdk1.6.0_43 /usr/lib/jvm  
# Update symbolic links for Java  
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_43/bin/java" 1  
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_43/bin/javac" 1  
update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_43/bin/javadoc" 1  
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_43/jre/lib/amd64/libnpjp2.so" 1  
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_43/bin/javaws" 1  
update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_43/bin/jar" 1  
# Choose the java you installed as default   
update-alternatives --config java  
update-alternatives --config javac  
update-alternatives --config javadoc  
update-alternatives --config mozilla-javaplugin.so  
update-alternatives --config javaws  
update-alternatives --config jar  
# Verify installation  
java -version  
javac -version  
# See more -  
# https://help.ubuntu.com/community/Java
~
~
~
 
这是我修改后的内容:
#!/bin/sh  
#  
# Download Sun JDK 6 from:  
# http://www.oracle.com/technetwork/java/javase/downloads/index.html  
# Java SE Development Kit 6 Update 43  
#  
# You can download it by browser  
# http://download.oracle.com/otn-pub/java/jdk/6u43-b01/jdk-6u43-linux-x64.bin  
# wget doesn't work  
#   
chmod +x jdk-6u43-linux-i586.bin  
./jdk-6u43-linux-i586.bin  
mkdir -p /usr/lib/jvm  
mv jdk1.6.0_43 /usr/lib/jvm  
# Update symbolic links for Java  
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_43/bin/java" 1  
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_43/bin/javac" 1  
update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_43/bin/javadoc" 1  
update-alternatives --install "/usr/lib/jvm/jdk1.6.0_43/jre/plugin/i386/ns7/libjavaplugin_oji.so " "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_43/jre/lib/i386/libnpjp2.so" 1  
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_43/bin/javaws" 1  
update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_43/bin/jar" 1  
# Choose the java you installed as default   
update-alternatives --config java  
update-alternatives --config javac  
update-alternatives --config javadoc  
update-alternatives --config mozilla-javaplugin.so  
update-alternatives --config javaws  
update-alternatives --config jar  
# Verify installation  
java -version  
javac -version  
# See more -  
# https://help.ubuntu.com/community/Java  
~
~
 
这里主要不同是:
jdk-6u43-linux-x64.bin   
改成了    
jdk-6u43-linux-i586.bin  
这文件可以在网上下载下来,在目录中替换掉jdk-6u43-linux-x64.bin就行。
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_43/jre/lib/amd64/libnpjp2.so" 1  
改成了
update-alternatives --install "/usr/lib/jvm/jdk1.6.0_43/jre/plugin/i386/ns7/libjavaplugin_oji.so " "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_43/jre/lib/i386/libnpjp2.so" 1
这里的路径要根据自己的ubuntu来改写。不懂路径可以收索文件来找路径。
 
出现这些错误的原因是讯为脚本是对64位ubuntu编译环境写的,而我的ubuntu是32位。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/26741.html