如何使用make-jpkg和fakeroot在Debian Wheezy上安装Oracle Java而不出错?

前端之家收集整理的这篇文章主要介绍了如何使用make-jpkg和fakeroot在Debian Wheezy上安装Oracle Java而不出错?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如何使用make-jpkg和fakeroot在Debian Wheezy上安装Oracle Java? @H_301_1@在debian wheezy上安装oracle java的手册非常清楚易懂:

@H_301_1@http://wiki.debian.org/JavaPackage
https://blogs.oracle.com/marigan/entry/installation_of_the_jdk_on
http://www.debian-administration.org/articles/142

@H_301_1@>从oracle下载jdk-7u21-linux-x64.tar.gz
>安装java-package
>使用jdk-7u21-linux-x64.tar.gz运行make-jpkg

@H_301_1@以root运行:

@H_301_1@make-jpkg jdk-7u21-linux-x64.tar.gz
fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

@H_301_1@导致以下错误

@H_301_1@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:

@H_301_1@fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

@H_301_1@which will allow no damage to be done to your system files and still
permit the Java distribution to successfully extract.

@H_301_1@Aborting.

@H_301_1@正常用户运行:

@H_301_1@make-jpkg jdk-7u21-linux-x64.tar.gz
fakeroot make-jpkg jdk-7u21-linux-x64.tar.gz

@H_301_1@结果都在警告/错误墙上.

@H_301_1@一些错误

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
@H_301_1@全输出
没有fakeroot
http://pastie.org/private/r2llqa2pubqzh8krhbymw

@H_301_1@与fakeroot
http://pastie.org/private/kigrgcsam9pvdazbex1fa

@H_301_1@安装工作正常:

dpkg -i oracle-j2sdk1.7_1.7.0+update21_amd64.deb
@H_301_1@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)
@H_301_1@是否可以安全地忽略错误

首先,您可以忽略dpkg-shlibdeps发出的警告.错误应该提示您需要安装哪些软件包以满足JDK的所有库依赖项. @H_301_1@发生这种情况的原因是您正在从二进制发行版构建deb包,即预编译的JDK.通常,Debian软件包是从源代码构建的,而不是从二进制文件构建的.为了做到这一点,构建包的人将把源所依赖的所有库添加到某个文件(debian / control).如果没有安装这些库,则无法编译源代码,因此不会生成包.

@H_301_1@在您的情况下,整个JDK已经由Oracle编译,make-jpkg仅模仿从源构建包的过程.因此,您无需事先安装所有必需的库.

@H_301_1@为了消除错误,您可以使用apt-file找出哪些包包含丢失的文件(libgtk-x11-2.0.so.0,libgdk-x11-2.0.so.0,libatk-1.0.so.0,.. .)并安装它们.

@H_301_1@或者你可以使用为Debian Wheezy预先打包的OpenJDK,并且可以通过apt-get install openjdk-7-jdk轻松安装.

猜你在找的Oracle相关文章