javaのupdate


`A critical Java serurity update is available.`なので、これをアップデートするかどうか検討してみた
<img width="707" alt="Screen Shot 2019-04-24 at 17.05.38.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/213053/8eb2d56a-c9a7-504f-b219-592d226aa9c2.png">

# Javaのライセンスについて

## 新しいライセンスはJava 8 (8u211)から適用
[Oracle の Blog](https://blogs.oracle.com/java-platform-group/oracle-java-se-releases-faq)によれば、 Java 8 (8u201)までは旧来のライセンスでデスクトップでもサーバー上でも無償利用が可能だけれど、2019年4月16日に提供されるJava8 (8u211)からは新しいライセンスに同意する必要がある

>Q4: What are the Java 8 “End of Public Updates” timelines?

>>The January 15th, 2019 scheduled Critical Patch Update of Java 8 (8u201, and the related 8u202 Patch Set Update) are the last update available under the BCL license which is generally free for general purpose desktop and server use, and has been the Oracle JDK license for several years.  **The following update of Java 8, scheduled for April 16, 2019 (8u211 and the related 8u212 Patch Set Update), will be made available under a new license** which will be free for personal individual desktop use, and free for development, testing, prototyping and demonstration purposes.

##Java 8 (8u201)を利用し続けても良いのか?

新しいライセンスが適用になるのはJava 8 (8u211)からなので、それ以前のバイナリーについてはBCLライセンスの元で自由に使い続けてかまわない。

> Q5: Can an update of Java 8, released before April 2019, and downloaded under the BCL, continue to be used after January 2019?

>>Yes.  **You can continue to use any version of Java under the license terms under which it was provided to you.**  New licensing for Java 8 updates only applies to updates released under the new license after January 2019, starting with the April 16th, 2019 scheduled quarterly update.

## Java 8 (8u201)を利用し続ける問題は?

* セキュリティー問題に対する対応がなされない

今回の5個のパッチのうち、一つはWindowsに固有のもの
基本的には、`CVE-2019-2602`を除いてJava Appletまたは、Java Web Startを利用しなければ影響を緩和できるように見える

https://www.oracle.com/technetwork/security-advisory/cpuapr2019-5072813.html#AppendixJAVA
> This Critical Patch Update contains 5 new security fixes for Oracle Java SE.  All of these vulnerabilities may be remotely exploitable without authentication, i.e., may be exploited over a network without requiring user credentials.  The English text form of this Risk Matrix can be found here.

>>
1. This vulnerability applies to Java deployments, typically in clients running sandboxed Java Web Start applications or sandboxed Java applets (in Java SE 8), that load and run untrusted code (e.g., code that comes from the internet) and rely on the Java sandbox for security. This vulnerability can also be exploited by using APIs in the specified Component, e.g., through a web service which supplies data to the APIs.
2. This vulnerability applies to Java deployments, typically in clients running sandboxed Java Web Start applications or sandboxed Java applets (in Java SE 8), that load and run untrusted code (e.g., code that comes from the internet) and rely on the Java sandbox for security. This vulnerability does not apply to Java deployments, typically in servers, that load and run only trusted code (e.g., code installed by an administrator).
3. This vulnerability can only be exploited by supplying data to APIs in the specified Component without using Untrusted Java Web Start applications or Untrusted Java applets, such as through a web service.

`CVE-2019-2602`については、影響は次の通り
> Successful attacks of this vulnerability can result in unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of Java SE, Java SE Embedded.


* 新しい元号(令和)に対応しない:smile:
    * 令和の合字の「U+32FF」にも対応しない

https://www.java.com/en/download/mac_java_update.jsp
>Change: New Japanese Era Name 
The placeholder name, "NewEra", for the Japanese era that started from May 1st, 2019 has been replaced with the Japanese Government declared name "Reiwa". Applications that rely on the placeholder name to obtain the new era singleton (JapaneseEra.valueOf("NewEra")) will no longer work.

## 新しいJava 8 (8u211)にアップデートした後に留意すること

* 個人利用限定でデスクトップで利用できる
    * 業務用途では使えない
        * 業務目的で利用するなら、最も安い場合でも月額300円でOracleとの契約が必要
* 開発目的利用、テスト利用、試作利用、デモでの利用は可能
>...which will be free for personal individual desktop use, and free for development, testing, prototyping and demonstration purposes.

* 機能停止日がハードコーディングされている
    * それまでにはアップデートする必要がある

###機能停止の日時
2019年7月16日に動作しなくなる(Oracleのサーバーに接続できる時)

>This JRE (version 8u211) will expire with the release of the next critical patch update scheduled for July 16, 2019.

Oracleのサーバーに接続できないようにしても、2019年8月16日には動作しなくなる

>For systems unable to reach the Oracle Servers, a secondary mechanism expires this JRE (version 8u211) on August 16, 2019. 

# それなら、OpenJDKにするのはどうなの？

* **Java applet**が動作しなくなる
    * Jmolなどが動作しなくなる(でも、JSmolがあるから大丈夫か？)
* OpenJDKの新しいバージョンで動作しないアプリケーションがあるかも

例えば IGVの場合...
<img width="1314" alt="Screen Shot 2019-04-24 at 17.12.43.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/213053/4e4130eb-811c-bb6f-026d-03951b34866c.png">

https://software.broadinstitute.org/software/igv/download

<img width="1109" alt="Screen Shot 2019-04-24 at 17.13.34.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/213053/d2818237-6561-02bc-dce9-c01451a522a1.png">
赤枠の中はJava 8用のアプリケーション

そもそも、Java 8 のReference ImplementationにはOS X用のバイナリが無い...
https://jdk.java.net/java-se-ri/8

とりあえず暫定的には、Java Appletの利用を禁止した上で、Java 8 (8u201)を利用し続けることにしよう

こんな結論で良いのか?

今回はここまで:smile: