{"id":21955260,"url":"https://github.com/mindawei/java9demo","last_synced_at":"2026-05-07T07:35:20.991Z","repository":{"id":215749584,"uuid":"119166993","full_name":"mindawei/Java9Demo","owner":"mindawei","description":"Java9学习Demo","archived":false,"fork":false,"pushed_at":"2018-01-27T14:50:43.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T23:15:31.600Z","etag":null,"topics":["demo","java9"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mindawei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-27T13:31:30.000Z","updated_at":"2018-01-27T14:42:17.000Z","dependencies_parsed_at":"2024-01-06T10:32:20.562Z","dependency_job_id":null,"html_url":"https://github.com/mindawei/Java9Demo","commit_stats":null,"previous_names":["mindawei/java9demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindawei%2FJava9Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindawei%2FJava9Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindawei%2FJava9Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mindawei%2FJava9Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mindawei","download_url":"https://codeload.github.com/mindawei/Java9Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245007170,"owners_count":20546143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","java9"],"created_at":"2024-11-29T07:30:16.459Z","updated_at":"2026-05-07T07:35:15.953Z","avatar_url":"https://github.com/mindawei.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Java9Demo\n----\n# 1 Java 9\n## 1.1 一些资源\n* [Java 9 官方文档](https://docs.oracle.com/javase/9/)\n* [Java 9 新特性](https://docs.oracle.com/javase/9/whatsnew/toc.htm#JSNEW-GUID-C23AFD78-C777-460B-8ACE-58BE5EA681F6)\n\n## 1.2 新特性概览\n以下摘自[《JDK 9新特性汇总》](http://blog.csdn.net/gmg082900/article/details/78067117)：\n\u003e\n\u003eJDK9的关键更改：\n\u003e 1. Java平台模块化系统：引入了一种新的Java编程组件模块，它是一个命名的、自描述的代码和数据集合。\n\u003e\n\u003eJDK 9中的新工具：\n\u003e 1. Java Shell\n\u003e 2. 添加更多的诊断命令\n\u003e 3. 删除启动时间JRE版本选择\n\u003e 4. jlink:Java连接器\n\u003e 5. 多版本兼容Jar\n\u003e\n\u003eJDK 9中新的安全性： \n\u003e 1. 数据报传输层安全性(DTLS）\n\u003e 2. 禁用sha - 1证书\n\u003e\n\u003eJDK 9中核心库的新内容:\n\u003e 1. 进程API更新：新增ProcessHandle类，该类提供进程的本地进程ID、参数、命令、启动时间、累计CPU时间、用户、父进程和子进程。这个类还可以监控进程的活力和破坏进程。ProcessHandle。onExit方法，当进程退出时，复杂未来类的异步机制可以执行一个操作。 \n\u003e 2. 更多的并发更新：包括一个可互操作的发布-订阅框架，以及对CompletableFuture API的增强。\n\u003e 3. 便利的工厂方法对于Collections：用少量的元素创建集合和映射的实例更容易。在列表、设置和映射接口上的新静态工厂方法使创建这些集合的不可变实例变得更加简单 例子：Set\u003cString\u003e alphabet = Set.of(\"a\", \"b\", \"c\");\n\n# 2 模块化\n* Java 9 的一个新特性就是支持模块化。\n* IDEA 中模块化 Demo 构建可以参考：[《Support for Java 9 Modules in IntelliJ IDEA 2017.1》](https://blog.jetbrains.com/idea/2017/03/support-for-java-9-modules-in-intellij-idea-2017-1/)。\n* 研一翻译的文章[《Java 模块化系统初探》](http://www.importnew.com/16761.html)\n\n## 2.1 模块化Demo\n关注两个模块: `module1` 和 `module2`。`module2` 中使用了 `module1` 中的 `utils` 包中的 `TimeUtil` 类。\n\n`module1` 中的module-info.java内容：\n```\nmodule module1 {\n    exports utils;\n}\n```\n\n`module2` 中的module-info.java内容：\n```\nmodule module2 {\n    requires module1;\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindawei%2Fjava9demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindawei%2Fjava9demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindawei%2Fjava9demo/lists"}