{"id":267278,"date":"2021-01-08T16:13:09","date_gmt":"2021-01-08T08:13:09","guid":{"rendered":"http:\/\/4563.org\/?p=267278"},"modified":"2021-01-08T16:13:09","modified_gmt":"2021-01-08T08:13:09","slug":"%e6%9c%89-jdk11-%e7%9a%84%e5%bc%80%e6%ba%90%e9%a1%b9%e7%9b%ae%e5%90%97%e9%9d%9e-demo","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=267278","title":{"rendered":"\u6709 jdk11 \u7684\u5f00\u6e90\u9879\u76ee\u5417(\u975e demo)"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6709 jdk11 \u7684\u5f00\u6e90\u9879\u76ee\u5417(\u975e demo)               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SkyLine7 <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e00\u76f4\u7528\u7684 jdk8,\u60f3\u5b66\u4e60\u4e00\u4e0b jdk11 \u7684\u65b0\u7279\u6027. 1.jdk8 \u5347\u7ea7\u5230 jdk11 \u6027\u80fd\u63d0\u5347\u5927\u5417\uff1f 2.jdk8 \u5347\u7ea7\u5230 jdk11 \u9700\u8981\u505a\u54ea\u4e9b\u64cd\u4f5c\uff0c\u6539\u52a8\u7684\u70b9\uff1f 3.jdk9 \u4e2d\u7684\u6a21\u5757\u5316\u62c6\u5305\u5982\u4f55\u8fd0\u7528\u5230\u771f\u5b9e\u7684\u5546\u4e1a\u9879\u76ee\u4e2d<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>20<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4871196\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hihanley <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u540c\u6837\u60f3\u4e86\u89e3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871197\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5546\u4e1a\u9879\u76ee\u6709\u4ec0\u4e48\uff0c\u6211\u53ef\u4ee5\u5e2e\u5347\u5230 15 \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871198\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : echo1937 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 JDK15 \u8dd1\u4e86\u4e00\u4e0b\u7528 JDK8 \u5f00\u53d1\u7684\u9879\u76ee\uff0c\u5565\u95ee\u9898\u4e5f\u6ca1\u53d1\u73b0\uff0c\u633a\u610f\u5916\u7684\u3002<\/p>\n<p>\u660e\u5e74\u4e0b\u534a\u5e74\u4e00\u5b9a\u8981\u628a\u5f00\u53d1\u73af\u5883\u8fc1\u79fb\u5230 JDK17 \u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871199\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5173\u952e\u8bed\u6cd5\u4e0a\u8fd8\u662f\u6709\u5dee\u522b\u7684\u3002Java 11 &#8211; 15 \u4ee5\u540e\u7684\u4e00\u4e9b\u5c0f\u7279\u6027\uff0c\u8fd8\u662f\u4e0d\u9519\u3002<\/p>\n<p>\u6bd4\u5982\uff1aText Block, var, Map.of\/List.of\/Set.of, record \u7b49\u3002<\/p>\n<p>https:\/\/github.com\/hantsy\/spring-playground\/blob\/master\/programming-models\/webmvc-fn\/src\/main\/java\/com\/example\/demo\/DemoApplication.java                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871200\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : SkyLine7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @echo1937 \u6709\u7528\u5230 jdk11 \u7684\u65b0\u7279\u6027\u5417\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871201\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Java Module \u76ee\u524d\u5927\u90e8\u5206\u5f00\u6e90\u7684\u9879\u76ee\u5df2\u7ecf\u6dfb\u52a0 module \u63cf\u8ff0\uff0c\u5305\u62ec Spring \u3002<\/p>\n<p>\u4e00\u53e5\u8bdd\uff0c\u4e0d\u597d\u7528\u3002<\/p>\n<p>\u76ee\u524d jmps \u7684\u4f9d\u8d56\u89e3\u6790\u4e5f\u6bd4\u8f83\u677e\u6563\uff0c\u6ca1\u6709 module \u63cf\u8ff0\u4e5f\u4f1a\u81ea\u52a8\u89e3\u6790\u3002 \u5230\u540e\u9762\u8fd9\u89c4\u80af\u5b9a\u4f1a\u4e25\u683c\u8d77\u6765\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871202\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : SkyLine7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @hantsy \u597d\u7684\uff0c\u8001\u54e5\u6709\u8fd9\u65b9\u9762\u7684\u9879\u76ee\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871203\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SkyLine7 \u751f\u4ea7\u9879\u76ee\u6211\u65e9\u5c31\u4e0a Java 11 \u4e86\u3002<br \/>\u4e2a\u4eba\u73a9\u4e00\u76f4\u5728\u5c1d\u8bd5\u6700\u65b0\u7684 Java \u3002\u4e0a\u9762\u7684\u8fde\u63a5 \u662f Java 15 \u5199\u7684\uff0c\u7528\u4e86\u65b0\u8bed\u6cd5\uff08 text block, record \u7b49\uff09\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871204\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qwerthhusn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4ece Java8 \u5230 11 \u5347\u7ea7\u4e0d\u9700\u8981\u4fee\u6539\u4efb\u4f55\u4ee3\u7801\uff0c\u8bed\u6cd5\u4e0a\u4e5f\u57fa\u672c\u4e0a\u6ca1\u6709\u53d8\u5316\uff0c\u6211\u80fd\u60f3\u5230\u7684\u5c31\u662f var \u4e86\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u4f60\u53ef\u4ee5\u9009\u62e9\u4e0d\u7528\uff0c\u6211\u4e5f\u5f88\u5c11\u7528\u3002module \u4e5f\u6ca1\u4f7f\u7528\uff0c\u4e0d\u5f71\u54cd\u4f7f\u7528 11 \u3002<\/p>\n<p>\u53cd\u6b63\u6211\u7684\u611f\u89c9\u662f 8 \u5230 11 \u6ca1\u6709\u5565\u5927\u7684\u65b0\u4e1c\u897f\u53ef\u4ee5\u7528\u3002<\/p>\n<p>\u5347\u7ea7\u7684\u8bdd\uff0c\u552f\u4e00\u53ef\u80fd\u9700\u8981\u6ce8\u610f\u7684\u5c31\u662f\u7b2c\u4e09\u65b9\u4f9d\u8d56\uff0c\u6709\u4e9b\u4f9d\u8d56\u6bd4\u8f83\u9648\u65e7\u4e0d\u652f\u6301 11                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871205\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xuweifeng1987 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5143\u65e6\u8282 jdk8&#8212;\u300b jdk11\uff0c\u4e00\u4e2a\u5b57\u7b26\u90fd\u6ca1\u6539\uff0c\u5b8c\u7f8e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871206\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : echo1937 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SkyLine7 #5 \u6211\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\uff0c\u662f\u7528 JDK15 \u7684\u73af\u5883\u5199 JDK8 \u7684\u4ee3\u7801\uff0c<\/p>\n<p>JDK9\uff0c\u96c6\u5408\u7c7b\u578b\u6709\u4e86 copyOf \u548c of \u65b9\u6cd5\uff0c\u4f46\u6211\u8fd8\u662f\u5728\u7528 Guava\uff0c<\/p>\n<p>JDK10\uff0c\u5c40\u90e8\u53d8\u91cf\u652f\u6301\u7c7b\u578b\u63a8\u5bfc var\uff0c\u6211\u8fd8\u662f\u4e60\u60ef\u5199\u5168\u7c7b\u578b\uff0c\u6216\u8005\u4f7f\u7528 Lombok\uff0c<\/p>\n<p>JDK11\uff0c\u6709\u4e86\u65b0\u7684 HttpClient API\uff0c\u672c\u60f3\u66ff\u6362\u6389\u7b2c\u4e09\u65b9\u7684 HttpClient API\uff0c\u4f46\u662f\u5f15\u5165\u7684\u5305\u6709\u9644\u5e26\u4f9d\u8d56\uff0c\u90a3\u7ee7\u7eed\u7528\u5427\uff0c<\/p>\n<p>\u7b80\u5355\u6765\u8bf4\uff0c\u9700\u8981\u4e00\u4e2a\u9002\u7528\u7684\u8fc7\u7a0b\uff0c\u6211\u6700\u559c\u6b22\u7684\u8fd8\u662f Text Block \u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871207\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @qwerthhusn 8-\u300b 11 \u7ec6\u8282\u4e0a\u7684\u4e1c\u897f\u8fd8\u662f\u6709\u4e0d\u5c11\u3002<br \/>1. var<br \/>2. Collection \u7684 of \u5de5\u5382\u65b9\u6cd5<br \/>3. Optional, Stream \u7b49\u589e\u5f3a\uff0c\u66f4\u65b9\u4fbf<br \/>4. HttpClient, Flow(ReactiveStreams API \u514b\u9686)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871208\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @echo1937 record, sealed \u90fd\u5b9e\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871209\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @echo1937 \u5b9e\u9645\u9879\u76ee\u4e2d\u65b0 Java \u7248\u672c\u8fd0\u884c\u6709\u6ca1\u6709\u95ee\u9898\uff0c\u4e22\u7ed9 CI \u5c31\u597d\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871210\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : industryhive <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             java8 \u7684 Hotspot \u51e0\u4e4e\u5df2\u7ecf\u4f18\u5316\u5230\u4e86\u6781\u9650\uff0c\u5347\u7ea7\u5230 java11\uff0c\u6027\u80fd\u63d0\u5347\u5f88\u5c0f\uff0c\u5927\u6982\u53ea\u6709 16%\u3002\u8981\u60f3\u7ee7\u7eed\u6316\u6398\u4f18\u5316\u6f5c\u529b\uff0c\u8fd8\u5f97\u770b graalvm \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871211\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hantsy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @industryhive \u5bf9\u4e8e\u5f00\u53d1\u800c\u8a00\uff0c\u6211\u6ca1\u6307\u671b\u8fc7\u6027\u80fd\u63d0\u5347\u3002\u8bed\u8a00\u672c\u8eab\u76f8\u5173\u7684\u8bed\u6cd5\u7684\u8fdb\u5316\u624d\u662f\u6211\u5173\u5fc3\u7684\u5173\u952e\u70b9\u3002<\/p>\n<p>\u81f3\u4e8e 16%\u561b\uff0c\u6211\u4e2a\u4eba\u8868\u793a\u5f88\u6000\u7591\u3002\u56e0\u4e3a\u770b\u8fc7\u56fd\u5185\u5916\u7684\u4e00\u4e9b\u5e38\u89c1 Java \u6846\u67b6\u7684\u4f7f\u7528\u7684\u4e0d\u540c\u7684 JDK \u7684 Benchmark \u7ed3\u679c\u60c5\u51b5\uff0c\u57fa\u672c\u4e0d\u4f1a\u6709\u4ec0\u4e48\u5f88\u5927\u63d0\u9ad8\uff08\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u5dee\u4e0d\u591a\uff09\uff0c\u4e2a\u522b\u6d4b\u8bd5\u53cd\u800c Java 8 \u5360\u4f18\u52bf\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u5347\u7ea7\uff0cJava 11 \u5199\u7a0b\u5e8f\u66f4\u723d\uff0c\u5c31\u8fd9\u4e48\u7b80\u5355\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871212\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : SkyLine7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @echo1937 \u597d\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u5347\u7ea7\u4e86\u7248\u672c\uff0c\u8fd8\u662f\u5f88\u591a\u7248\u672c\u65b0\u7279\u6027\u6ca1\u7528\u4e0a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871213\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : echo1937 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @SkyLine7 #17 \u4e60\u60ef\u662f\u5f88\u53ef\u6015\u7684\u4e1c\u897f\uff0c\u7ec4\u91cc\u7684\u6709\u4e9b\u540c\u4e8b\uff0cJDK8 \u7684 Steam API \u548c Lambda \u90fd\u7528\u4e0d\u5229\u7d22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871214\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : byte10 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @qwerthhusn \u4e0d\u662f\u5411\u4e0b\u517c\u5bb9\u5417\uff0c\u5565\u9879\u76ee\u4e0d\u80fd\u4f7f\u7528 11 \u8fd0\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4871215\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tmackan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Java8 \u4e0d\u633a\u597d\u5417\u3002\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6709 jdk11 \u7684\u5f00\u6e90\u9879\u76ee\u5417(\u975e &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/267278"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=267278"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/267278\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=267278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=267278"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=267278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}