在OpenSuse 42.3上安装Java 9时出现“cp:can not stat”错误

时间:2017-09-27 19:49:34

标签: opensuse java-9

我正在尝试在OpenSuse 42.3上安装Java 9。 我已经下载了java 9 rpm文件,并试图在OpenSuse 42.3上安装,但我得到以下错误。

user@localhost:~> sudo rpm -ivh Downloads/jdk-9_linux-x64_bin.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:jdk-9-2000:9-ga                  ################################# [100%]
Unpacking JAR files...
    plugin.jar...
    javaws.jar...
    deploy.jar...
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/16x16/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/16x16/apps/sun-javaws.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-java.png': No such file or directory
cp: cannot stat '/usr/java/jdk-9/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png': No such file or directory
update-alternatives: using /usr/java/jdk-9/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: error: alternative appletviewer can't be slave of javac: it is a slave of java
warning: %post(jdk-9-2000:9-ga.x86_64) scriptlet failed, exit status 2

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

我在Centos7上安装了Java 9.0.4并且只能获得'无法统计'消息,但安装似乎没问题:

sudo rpm -ivh jdk-9.0.4_linux-x64_bin.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:jdk-9.0.4-2000:9.0.4-ga          ################################# [100%]
Unpacking JAR files...
    plugin.jar...
    javaws.jar...
    deploy.jar...
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/16x16/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/16x16/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/16x16/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/16x16/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/HighContrast/48x48/apps/sun-javaws.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-java.png’: No such file or directory
cp: cannot stat ‘/usr/java/jdk-9.0.4/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png’: No such file or directory
:

安装后的目录树如下所示:

:tree /usr/java/jdk-9.0.4/lib/desktop/icons

/usr/java/jdk-9.0.4/lib/desktop/icons
├── hicolor
│   ├── 16x16
│   │   ├── apps
│   │   │   └── sun-jcontrol.png
│   │   └── mimetypes
│   │       ├── gnome-mime-application-x-java-archive.png
│   │       ├── gnome-mime-application-x-java-jnlp-file.png
│   │       └── gnome-mime-text-x-java.png
│   └── 48x48
│       ├── apps
│       │   └── sun-jcontrol.png
│       └── mimetypes
│           ├── gnome-mime-application-x-java-archive.png
│           ├── gnome-mime-application-x-java-jnlp-file.png
│           └── gnome-mime-text-x-java.png
├── HighContrast
...