0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

JDK9のマイグレーションガイドを読む_001

0
Posted at

少し気になる部分があるので読んでみたい。
原文_JDK9マイグレーションガイド

The purpose of this guide is to help you identify potential issues and give you suggestions on how to proceed as you migrate your existing Java application to JDK 9.

この文章は、Java言語が8→9にバージョンアップすることにより、仕様変更で挙動が変わった箇所を記載します。同作業を実施する際に役立ててください。

Every new Java SE release introduces some binary, source, and behavioral incompatibilities with previous releases. The modularization of the Java SE Platform brings many benefits, but also many changes. Code that uses only official Java SE Platform APIs and supported JDK-specific APIs should continue to work without change. Code that uses JDK-internal APIs should continue to run but should be migrated to use external APIs.

Java言語はバージョンの下位互換性を保証していますが、いくつかの機能で非互換となっているものがあります。たとえば9ではモジュール化という機能を追加しましたが、非常に多くのソースコードを修正しています。互換性の考え方としては、JREのランタイムに内包されるAPI、JDKのうちサポートを明言しているAPIのみを利用するコードはJava9と、下位バージョンで差異がないはずです。主に修正が必要なのはサードパーティのライブラリ、サポート対象外のAPIです。

New Version-String Scheme

JDK 9 provides a new simplified version-string format. If your code relies on the version-string format to distinguish major, minor, security, and patch update releases, then you may need to update it.

Java言語ではバージョン文字列の形が新しくなっています。もしプログラムから言語のバージョン文字列の形からメジャーバージョン値、マイナーバージョン値、セキュリティパッチバージョン値をを取得して分岐する処理などは修正が必要になります。

The format of the new version-string is:
新しいバージョンのフォーマットは以下です

$MAJOR.$MINOR.$SECURITY.$PATCH

For example, under the old scheme, the Java 9u5 security release would have the version string 1.9.0_5-b20.

例を挙げると、下位バージョンの文字列は↑のような形でした。

Under the new scheme, the short version of the same release is 9.0.1, and the long version is 9.0.1+20.

新しいバージョンの文字列は↑のような形となります。

This change affects java -version and related system properties, such as java.runtime.version, java.vm.version, java.specification.version, and java.vm.specification.version.

この変更は、上記のコマンドやAPIの出力内容に影響あります。

A simple Java API to parse, validate, and compare version strings has been added. See java.lang.Runtime.Version.

毎度バージョン更新時に問題が出ないよう、より単純な形でバージョンを取得できるJava APIを作成しました。

See Version String Format in Java Platform, Standard Edition Installation Guide, and JEP 223: New Version-String Scheme.

詳細はドキュメントに記載しているので、そちらを参照してください。
JEP 223: New Version-String Scheme

今日はここまで。後日追記します。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?