rpi 上的 Webupd8 Oracle Java8 缺少 javaws.policy

rpi 上的 Webupd8 Oracle Java8 缺少 javaws.policy

我正在尝试在我的 raspberry pi 3 上安装 Oracle java8。

我的脚本遵循以下说明http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html。我尝试了下载 tar 和允许安装程序自动下载这两个选项。两者都导致相同的错误:

$ sudo apt-get install oracle-java8-installer
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  libopts25 python3-urllib3
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  binfmt-support visualvm ttf-baekmuk | ttf-unfonts | ttf-unfonts-core
  ttf-kochi-gothic | ttf-sazanami-gothic ttf-kochi-mincho
  | ttf-sazanami-mincho ttf-arphic-uming firefox | firefox-2 | iceweasel
  | mozilla-firefox | iceape-browser | mozilla-browser | epiphany-gecko
  | epiphany-webkit | epiphany-browser | galeon | midbrowser
  | moblin-web-browser | xulrunner | xulrunner-1.9 | konqueror
  | chromium-browser | midori | google-chrome
The following NEW packages will be installed:
  oracle-java8-installer
Preconfiguring packages ...
0 upgraded, 1 newly installed, 0 to remove and 72 not upgraded.
Need to get 0 B/23.5 kB of archives.
After this operation, 93.2 kB of additional disk space will be used.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 31968 files and directories currently installed.)
Preparing to unpack .../oracle-java8-installer_8u101+8u101arm-1~webupd8~0_all.deb ...
oracle-license-v1-1 license has already been accepted
Unpacking oracle-java8-installer (8u101+8u101arm-1~webupd8~0) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2) ...
Setting up oracle-java8-installer (8u101+8u101arm-1~webupd8~0) ...
Installing from local file /var/cache/oracle-jdk8-installer/jdk-8u101-linux-arm32-vfp-hflt.tar.gz
Removing outdated cached downloads...
update-alternatives: error: no alternatives for java
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/jre/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/extcheck to provide /usr/bin/extcheck (extcheck) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/idlj to provide /usr/bin/idlj (idlj) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javah to provide /usr/bin/javah (javah) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jhat to provide /usr/bin/jhat (jhat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jsadebugd to provide /usr/bin/jsadebugd (jsadebugd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/native2ascii to provide /usr/bin/native2ascii (native2ascii) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/schemagen to provide /usr/bin/schemagen (schemagen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsgen to provide /usr/bin/wsgen (wsgen) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/wsimport to provide /usr/bin/wsimport (wsimport) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-oracle/bin/xjc to provide /usr/bin/xjc (xjc) in auto mode
mv: cannot stat '/usr/lib/jvm/java-8-oracle/jre/lib/security/javaws.policy': No such file or directory
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java8-installer

请注意下面的行,我认为这是导致错误的原因。

mv: cannot stat '/usr/lib/jvm/java-8-oracle/jre/lib/security/javaws.policy': No such file or directory

我用谷歌搜索过广泛地并且在互联网上的任何地方都找不到对此的任何提及。

奇怪的是,几个月前我已经用这个脚本配置了几十个 Pis,尽管当时由于其他原因这也是一件令人头疼的事,但我没有遇到这个问题。

有人有什么想法吗?或者能给我指出一个论坛/irc 频道吗?在那里可以找到可能有想法的人?

欢呼,非常感谢

答案1

由于某种原因,此文件必须从安装中删除。也许您可以等待他们修复发行版。我编写了一个小脚本,用于监视目标目录的创建,然后将 javaws.policy 文件放入其中。

while [ ! -d "/usr/lib/jvm/java-8-oracle/jre/lib/security/" ]
  do
  sleep 1
  done
cp javaws.policy /usr/lib/jvm/java-8-oracle/jre/lib/security/

我在一个窗口中安装/更新之前启动了该脚本,然后在另一个窗口中进行了安装/更新。

以下是我创建的 javaws.policy 的内容:

grant codeBase "file:${jnlpx.home}/javaws.jar" {
    permission java.security.AllPermission;
};

我并不是太关心内容,因为我怀疑我是否会在这个平台上使用 Java WebStart。

相关内容