Please enable javascript to use this site.
· OpenID

  1. Thursday, 27-Jul-2017 06:42:30 JST における Kenichiro MATOHARA (matoken) のステータス Kenichiro MATOHARA Kenichiro MATOHARA
    Debian arm64環境にOracle Java導入めも


    AsciidocFXはOpenJDKで動かないぽいのでOracle Java入れてみました.

    Oracle Javaは `java-package` を使うといいぽい

    * https://wiki.debian.org/JavaPackage[JavaPackage - Debian Wiki]

    ということでまずは `java-package` pkgを導入.

    ----
    $ sudo apt install java-package
    ----

    Oracleからjreを入手と思ったらarmおらんかった……

    * http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html[Java SE Runtime Environment 8 - Downloads]

    jdkには `Linux ARM 32 Hard Float ABI`, `Linux ARM 64 Hard Float ABI` があるのでこれを入れてみる.

    * http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html[Java SE Development Kit 8 - Downloads]

    しかしぐぬぬ.

    ----
    $ make-jpkg ./jdk-8u141-linux-arm64-vfp-hflt.tar.gz
    Creating temporary directory: /tmp/make-jpkg.wW7eUWpw3m
    Loading plugins: /usr/share/java-package/common.sh /usr/share/java-package/javase.sh /usr/share/java-package/jdk-doc.sh /usr/share/java-package/oracle-jdk-doc.sh /usr/share/java-package/oracle-jdk.sh /usr/share/java-package/oracle-jre.sh /usr/share/java-package/oracle-server-jre.sh

    Detected Debian build architecture: arm64
    Detected Debian GNU type: aarch64-linux-gnu

    No matching packaging method was found for jdk-8u141-linux-arm64-vfp-hflt.tar.gz.
    Please make sure you are using a tar.gz or a self-extracting archive
    Removing temporary directory: done

    ----

    jdkのarchiveを展開して `jaja -version` とかしてみると動くようなのでダウンロードするファイルは合っていそう.

    バグとして上がっていた.

    * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863247[# - java-package: ARM support bitrotted - Debian Bug report logs]

    こちらのパッチを使わせてもらう.

    * https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=863247;filename=java-package.patch;msg=10[https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=863247;filename=java-package.patch;msg=10]

    ----
    $ wget 'https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=863247;filename=java-package.patch;msg=10' -O java-package.patch
    $ sudo patch -P0 -d / < ./java-package.patch
    $ time make-jpkg ./jdk-8u141-linux-arm64-vfp-hflt.tar.gz
    :
    real 9m58.079s
    user 8m53.790s
    sys 1m29.510s
    $ sha256sum oracle-java8-jdk_8u141_arm64.deb
    93a9b6136195616db7e33749eec783a224a125c2b3529385b548a49f5189af12 oracle-java8-jdk_8u141_arm64.deb
    $ sudo dpkg -i oracle-java8-jdk_8u141_arm64.deb
    ----

    javaをOracleに切り替える.

    ----
    $ sudo update-alternatives --config java
    There are 2 choices for the alternative java (providing /usr/bin/java).

    Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /usr/lib/jvm/java-8-openjdk-arm64/jre/bin/java 1081 auto mode
    1 /usr/lib/jvm/java-8-openjdk-arm64/jre/bin/java 1081 manual mode
    2 /usr/lib/jvm/oracle-java8-jdk-arm64/jre/bin/java 318 manual mode

    Press <enter> to keep the current choice[*], or type selection number: 2
    update-alternatives: using /usr/lib/jvm/oracle-java8-jdk-arm64/jre/bin/java to provide /usr/bin/java (java) in manual mode
    $ java -version
    java version "1.8.0_141"
    Java(TM) SE Runtime Environment (build 1.8.0_141-b15)
    Java HotSpot(TM) 64-Bit Server VM (build 25.141-b15, mixed mode)
    ----

    ところで,なぜOracle Javaをarmで動かしたかったかというとAsciidocFXが実用的かどうかを試したかったからでした.しかし警告を出してすぐに終了してしまいました…….
    armで未実装の機能を使っている感じでしょうか?

    ----
    $ AsciidocFX_Linux_No_JRE/AsciidocFX
    Java HotSpot(TM) 64-Bit Server VM warning: G1 GC is disabled in this release.
    ----

    てことで削除しました…….(169MBの容量が開放されました)

    ----
    $ sudo apt purge oracle-java8-jdk java-package
    $ sudo rm -rf /usr/share/java-package
    ----