在debian wheezy上安装oracle java的手册非常清楚易懂:
http://wiki.debian.org/JavaPackage
https://blogs.oracle.com/marigan/entry/installation_of_the_jdk_on
http://www.debian-administration.org/articles/142
>从oracle下载jdk-7u21-linux-x64.tar.gz
>安装java-package
>使用jdk-7u21-linux-x64.tar.gz运行make-jpkg
以root运行:
make-jpkg jdk-7u21-linux-x64.tar.gz
fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz
导致以下错误:
You are real root — unfortunately,some Java distributions have
install scripts that directly manipulate /etc,and may cause some
inconsistencies on your system. Instead,you should become a non-root
user and run:fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz
which will allow no damage to be done to your system files and still
permit the Java distribution to successfully extract.Aborting.
正常用户运行:
make-jpkg jdk-7u21-linux-x64.tar.gz
fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz
结果都在警告/错误墙上.
一些错误:
dpkg-shlibdeps: warning: Can't extract name and version from library name `libverify.so' error: couldn't find library libxslt.so.1 needed by /tmp/make-jpkg.MxvYKHyE3L/install/usr/lib/jvm/j2sdk1.7-oracle/jre/lib/amd64/libjfxwebkit.so (ELF format: 'elf64-x86-64'; RPATH: '') dpkg-gencontrol: warning: Depends field of package oracle-j2sdk1.7: unknown substitution variable ${shlibs:Depends} dpkg-shlibdeps: error: cannot continue due to the errors listed above
全输出:
没有fakeroot
http://pastie.org/private/r2llqa2pubqzh8krhbymw
与fakeroot
http://pastie.org/private/kigrgcsam9pvdazbex1fa
安装工作正常:
dpkg -i oracle-j2sdk1.7_1.7.0+update21_amd64.deb
java版本:
java -version java version "1.7.0_21" Java(TM) SE Runtime Environment (build 1.7.0_21-b11) Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01,mixed mode)
是否可以安全地忽略错误?
发生这种情况的原因是您正在从二进制发行版构建deb包,即预编译的JDK.通常,Debian软件包是从源代码构建的,而不是从二进制文件构建的.为了做到这一点,构建包的人将把源所依赖的所有库添加到某个文件(debian / control).如果没有安装这些库,则无法编译源代码,因此不会生成包.
在您的情况下,整个JDK已经由Oracle编译,make-jpkg仅模仿从源构建包的过程.因此,您无需事先安装所有必需的库.
为了消除错误,您可以使用apt-file找出哪些包包含丢失的文件(libgtk-x11-2.0.so.0,libgdk-x11-2.0.so.0,libatk-1.0.so.0,.. .)并安装它们.
或者你可以使用为Debian Wheezy预先打包的OpenJDK,并且可以通过apt-get install openjdk-7-jdk轻松安装.