JavaOne 2016 Java SE Feedback #jjug #j1jpYuji Kubota
?
狠狠撸 for reporting Java SE Feedback of JavaOne 2016 at Japan Java User Group. Especially, this slide introduces the changes required for Java 9.
https://jjug.doorkeeper.jp/events/52639
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]David Buck
?
Java SE 8の主要な機能として、Lambda(クロージャ)とデフォルト?メソッド(従来ディフェンダー?メソッドもしくはエクステンション?メソッドと呼ばれていた)があります。クロージャを言語に追加することによってアプリケーションやライブラリに新たな表現の機会が与えられましたが、実際にはどのように実装すべきなのでしょうか。Lambdaはインナー?クラスによってシンプルでかつ文法的にコンパクトになるということは広く理解されていると思います。しかし、現実にはLambdaによる記述は、Invokedynamicを使った実装によって従来のJavaとは異なったものになっています。本セッションでLambdaについて、さらに深く理解してください。
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]David Buck
?
Java SE 8の主要な機能として、Lambda(クロージャ)とデフォルト?メソッド(従来ディフェンダー?メソッドもしくはエクステンション?メソッドと呼ばれていた)があります。クロージャを言語に追加することによってアプリケーションやライブラリに新たな表現の機会が与えられましたが、実際にはどのように実装すべきなのでしょうか。Lambdaはインナー?クラスによってシンプルでかつ文法的にコンパクトになるということは広く理解されていると思います。しかし、現実にはLambdaによる記述は、Invokedynamicを使った実装によって従来のJavaとは異なったものになっています。本セッションでLambdaについて、さらに深く理解してください。
JavaOne 2017 報告会 at Japan Java User Group
デモのコード:https://github.com/ykubota/jigsaw-sample_jp
イベントページ:https://jjug.doorkeeper.jp/events/66256
Stream: https://www.youtube.com/watch?v=XT2tIh9r6Eo
slideshareが自動的にPDFに変換するように仕様変更されていたため、ノート付きでアップロードができませんでした。お手数をおかけしますが、原稿(簡単ですが…)を読んでみたい方は筆者までTwitterでDMかメールなどでご連絡お願いします。
Head toward Java 14 and Java 15 #LINE_DMYuji Kubota
?
Java 14 and 15 introduced several new features and changes including records, pattern matching, text blocks, and updates to the garbage collector. Some notable changes were the addition of records as a new data type, enabling pattern matching for instanceof, and deprecating biased locking and the CMS garbage collector. Tools were also improved with the packaging tool to create installers and event streaming to collect JVM events.
This document discusses new features and changes in Java 14 and previews for Java 15. For Java 14, it outlines 16 JEPs including helpful null pointer exceptions, NUMA-aware memory allocation, and removing legacy garbage collectors. It also covers new tools like JFR event streaming and the packaging tool. For Java 15, hidden classes, removing Nashorn, and low-latency garbage collectors like ZGC and Shenandoah are previewed. Overall it provides a concise yet informative summary of major changes and previews for Java 14 and 15.
Secrets of Rock Star Developers (and How to Become One!) [CON7615] (Yuji KUBO...Yuji Kubota
?
Kubota Yuji is a Java technical support engineer at NTT and a hard-of-hearing open source developer. He recommends reading code and writing code through trial and error. Maintaining documentation and comments is important to help others. Conversation through chat, mailing lists, and tweets from conferences help hard-of-hearing developers. Written knowledge from articles and books also provide assistance, as do watching sessions on YouTube with subtitles. Attending JUGs can introduce developers to professionals. With helpful accessibility options and kind communities, hard-of-hearing people need not give up on becoming good developers.
The document discusses using jcmd to troubleshoot Java applications. It provides an overview of the jcmd command and describes the various domains and suffixes that can be used with jcmd to obtain diagnostic information or control the JVM. These include getting thread dumps, heap details, JIT compiler data, and configuring Java logging. The document also demonstrates some example jcmd commands.
JDK9 Features (Summary, 31/Jul/2015) #JJUGYuji Kubota
?
The document is a presentation by Yuji Kubota detailing the features and schedule for Java Development Kit 9 (JDK 9), set to reach general availability by September 22, 2016. Key features include updates to the process API, introduction of HTTP/2 client, enhanced locking mechanisms, unified JVM logging, and modularization of JDK source code. The slide emphasizes changes relevant to both developers working on JVM products and those developing applications in Java.
Java 女子部 講義資料
https://javajo.doorkeeper.jp/events/21337
This presentation is used to lecture about the introduction of Java Virtual Machine at Java Japan User Group (Girls).
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...Yuji Kubota
?
The document discusses a new runtime monitoring tool called HeapStats that provides a lightweight Java agent for collecting troubleshooting information from a Java application. It summarizes problems with current troubleshooting approaches like insufficient logging and complicated settings. HeapStats aims to collect required information continuously with low overhead, and provide easy-to-use visualization of the collected data to help with troubleshooting memory and performance issues. The document demonstrates how HeapStats hooks into garbage collection to gather heap statistics without extra stop-the-world pauses.
11. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
ー 関わ 言語や ー 変更点
Copyright?2015 NTT corp. All Rights Reserved. 11
12. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javacRead-Eval-Print-Loop Java 場
Good-bye {Sample,Example,Test}.java
Copyright?2015 NTT corp. All Rights Reserved. 12
13. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
検索機能追加, HTML5対応, Doclet 改善, 等
Copyright?2015 NTT corp. All Rights Reserved. 13
14. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
javac 古い ー ン N 合わせ 場合
-source N -target N 他
-bootclasspath jdkN/lib/rt.jar 必要
-release N
後 過去 3 ー ン 対応(9 6)
Copyright?2015 NTT corp. All Rights Reserved. 14
15. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac“_” 命 禁 , private interface methods,
匿 ン 対応, 等
Copyright?2015 NTT corp. All Rights Reserved. 15
16. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
jdk javac lint warnings 0
Copyright?2015 NTT corp. All Rights Reserved. 16
17. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
超要約 Diamond Nest祭 く
Copyright?2015 NTT corp. All Rights Reserved. 17
18. Language and Tooling
? User-facing features
–jshell
–Java.Doc.Next
–Cross compiling and the javac –release
–Milling Project Coin
–Deprecation and imports
? Re-engineering javac
出展:https://blogs.oracle.com/darcy/resource/JavaOne/J1_2015-jdk9-
langtools.pdf P.99
Copyright?2015 NTT corp. All Rights Reserved. 18
27. 大雑把 ー
? Before
依 関係 明確
Copyright?2015 NTT corp. All Rights Reserved. 27
a.jar
d.jarc.jar
b.jar
?
? After
mod a
mod dmod c
mod b
$ java –mp mod_dir
mymod.Main
$ java –cp a.jar:
b.jar:c.jar:d.jar
myapp.Main
28. 実際 ー 作成方法 追 行 う
Copyright?2015 NTT corp. All Rights Reserved. 28
ー 作成
46. Accessibility
–public to everyone
–public but only to specific modules
–public only within a module
–protected
–<package>
–private
JDK9 public 範 指定可能 !
Copyright?2015 NTT corp. All Rights Reserved. 46
exports p;
exports p to m;
exports
56. 実行
? -m <module>/<main-class>
そ 実行 -m 新 く必要
Copyright?2015 NTT corp. All Rights Reserved. 56
$ java –mp mods
–m com.foo.app/com.foo.app.Main
Hello world from module com.foo.app!
module name main class
58. modular JAR 作 方
? -C <path/to/module>
--module-version ー ン 入力可能
Copyright?2015 NTT corp. All Rights Reserved. 58
$ jar –-create –-file mlib/app.jar
--main-class com.foo.app.Main
-C mods/com.foo.app .
module-info.class
com/foo/app/Main.class
:
app.jar
59. modular JAR 確認
? --print-module-descriptor (-p)
java.base 基底 ー = MANDATED
Copyright?2015 NTT corp. All Rights Reserved. 59
$ jar -p –-file mlib/app.jar
Name:
com.foo.app
Requires:
java.base [ MANDATED ]
:
Main class:
com.foo.app.Main
60. modular JAR 実行
? -mp <path/to/jar>
Copyright?2015 NTT corp. All Rights Reserved. 60
$ java –mp mlib –m com.foo.app
Hello world from module com.foo.app!
jar 生成時 ン 指定
-m ン 不要
61. classpath modular jar
? -cp <path/to/jar>
Copyright?2015 NTT corp. All Rights Reserved. 61
$ java -cp mlib/app.jar com.foo.app.Main
Hello world from module com.foo.app!
後方互換性 あ java -jar app.jar OK
62. 別 jar 依 あ 場合
? bar.jar 必要 ー 想定
bar.jar 含 必要 ー
Copyright?2015 NTT corp. All Rights Reserved. 62
Exception in thread "main" java.lang.NoClassDefFoundError: com/foo/bar/Something
at com.foo.app.Main.main(Main.java:8)
Caused by: java.lang.ClassNotFoundException: com.foo.bar.Something
at jdk.internal.misc.BuiltinClassLoader.loadClass(java.base@9.0/BuiltinClassLoader.java:368)
at
jdk.internal.misc.ClassLoaders$AppClassLoader.loadClass(java.base@9.0/ClassLoaders.java:167)
at java.lang.ClassLoader.loadClass(java.base@9.0/ClassLoader.java:373)
... 1 more
$ java -cp mlib/app.jar com.foo.app.Main
63. 別 jar 依 あ 場合
? ー 非対応 JAR 場合
Copyright?2015 NTT corp. All Rights Reserved. 63
$ java -cp /path/to/bar.jar:mlib/app.jar
com.foo.app.Main
Hello world from module com.foo.app!
後方互換性 あ ー 対応 JAR
場合 方法 利用可能
64. 別 jar 依 あ 場合
? ー 対応 JAR 場合
Copyright?2015 NTT corp. All Rights Reserved. 64
$ java -mp /directory/of/bar.jar/
–addmods com.foo.bar
-cp mlib/app.jar com.foo.app.Main
Hello world from module com.foo.app!
-mp 指定 場合 addmods 必要
-mp く 指定
65. 別 jar 依 あ 場合
?
Copyright?2015 NTT corp. All Rights Reserved. 65
$ java -mp <Modular JAR >
-cp <Modular 非対応 JAR 列挙>
-m com.foo.app
Hello world from module com.foo.app!
個人的
79. 実行 before/after
? Before
? After
Copyright?2015 NTT corp. All Rights Reserved. 79
$ java –cp lib/myapp.jar:lib/mylib.jar:
lib/external-core-1.2.3.jar:
lib/external-lib-1.2.3.jar
myapp.Main
$ java –mp mlib:lib –m myapp
80. End
Copyright?2015 NTT corp. All Rights Reserved. 80
Jigsaw 考え方
出展: http://openjdk.java.net/projects/jigsaw/j1/jigsaw-under-
the-hood-j1-2015.pdf P.58