{"id":94230,"date":"2026-08-14T00:18:05","date_gmt":"2026-08-13T16:18:05","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/94230.html"},"modified":"2026-08-14T00:18:05","modified_gmt":"2026-08-13T16:18:05","slug":"idea-%e6%8a%a5-source-16-%e4%b8%8d%e6%94%af%e6%8c%81-switch-%e6%a8%a1%e5%bc%8f%e5%8c%b9%e9%85%8d%ef%bc%9f%e5%8f%af%e8%83%bd%e6%98%af%e4%bd%a0%e7%9a%84-idea-%e7%89%88%e6%9c%ac%e5%a4%aa%e8%80%81","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/94230.html","title":{"rendered":"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86"},"content":{"rendered":"<p>\u4e00\u6b21\u300cJava 21 \u9879\u76ee\u7f16\u8bd1\u62a5\u9519\u300d\u7684\u5b8c\u6574\u6392\u67e5\u8bb0\u5f55&#xff0c;\u5e0c\u671b\u5e2e\u540e\u6765\u8005\u5c11\u8d70\u5f2f\u8def\u3002<\/p>\n<h3>\u4e00\u3001\u95ee\u9898\u73b0\u8c61<\/h3>\n<p>\u6211\u65b0\u5efa\u4e86\u4e00\u4e2a Java 21 &#xff08;\u7b2c\u4e00\u6b21\u4f7f\u7528&#xff09;\u7684 Spring Boot \u9879\u76ee&#xff0c;\u7528 IDEA \u6253\u5f00\u540e\u7f16\u8bd1\u62a5\u9519&#xff1a;<\/p>\n<p>java: -source 16 \u4e2d\u4e0d\u652f\u6301 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f<br \/>\n&#xff08;\u8bf7\u4f7f\u7528 -source 21 \u6216\u66f4\u9ad8\u7248\u672c\u4ee5\u542f\u7528 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f&#xff09;<\/p>\n<p>\u62a5\u9519\u5b9a\u4f4d\u5230\u4e00\u884c\u7528\u4e86 Java 21 \u65b0\u589e\u7684 switch \u6a21\u5f0f\u5339\u914d \u7684\u4ee3\u7801&#xff1a;<\/p>\n<p><span class=\"token keyword\">return<\/span> <span class=\"token keyword\">switch<\/span> <span class=\"token punctuation\">(<\/span>xxx<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token class-name\">A<\/span> a <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">case<\/span> <span class=\"token class-name\">B<\/span> b <span class=\"token operator\">-&gt;<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7b2c\u4e00\u53cd\u5e94\u5f88\u81ea\u7136&#xff1a;JDK \u7248\u672c\u4e0d\u5bf9&#xff0c;\u9700\u8981\u88c5 JDK 21\u3002<\/p>\n<h3>\u4e8c\u3001\u6392\u67e5\u8e29\u5751\u8fc7\u7a0b<\/h3>\n<h4>\u7b2c 1 \u6b65&#xff1a;\u88c5 JDK 21&#xff08;\u65b9\u5411\u5bf9&#xff0c;\u4f46\u6ca1\u89e3\u51b3&#xff09;<\/h4>\n<p>\u88c5\u4e0a JDK 21 \u540e&#xff0c;\u5728 Project Structure \u91cc\u628a Project SDK \u5207\u5230 21&#xff0c;\u91cd\u65b0\u7f16\u8bd1\u2014\u2014\u62a5\u9519\u4f9d\u65e7\u3002<\/p>\n<h4>\u7b2c 2 \u6b65&#xff1a;\u6000\u7591\u7f16\u8bd1\u8bbe\u7f6e\u6ca1\u5bf9\u9f50&#xff08;\u7ed5\u4e86\u5f2f\u8def&#xff09;<\/h4>\n<p>\u63a5\u4e0b\u6765\u6211\u82b1\u4e86\u5927\u91cf\u65f6\u95f4\u5728 IDEA \u7684\u7f16\u8bd1\u8bbe\u7f6e\u91cc\u6253\u8f6c&#xff1a;<\/p>\n<ul>\n<li>Project Structure &gt; Project \u7684 SDK \/ Language level<\/li>\n<li>Settings &gt; Compiler &gt; Java Compiler \u7684 bytecode version<\/li>\n<li>Settings &gt; Maven &gt; Runner \u7684 JRE<\/li>\n<li>\u751a\u81f3 File &gt; Invalidate Caches \u6e05\u7f13\u5b58<\/li>\n<\/ul>\n<p>\u7ed3\u679c -source 16 \u62a5\u9519\u7eb9\u4e1d\u4e0d\u52a8\u3002<\/p>\n<h4>\u7b2c 3 \u6b65&#xff1a;\u7528\u547d\u4ee4\u884c Maven \u7f16\u8bd1&#xff0c;\u5c45\u7136\u6210\u529f\u4e86<\/h4>\n<p>\u62b1\u7740\u8bd5\u4e00\u8bd5\u7684\u5fc3\u6001&#xff0c;\u7528\u547d\u4ee4\u884c\u7f16\u8bd1&#xff1a;<\/p>\n<p><span class=\"token variable\">$env<\/span>:JAVA_HOME &#061; <span class=\"token string\">&#034;D:\\\\develop\\\\Java\\\\jdk-21&#034;<\/span><br \/>\n<span class=\"token variable\">$env<\/span>:Path &#061; <span class=\"token string\">&#034;<span class=\"token variable\">$env<\/span>:JAVA_HOME\\\\bin;&#034;<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token variable\">$env<\/span>:Path<br \/>\nmvn spring-boot:run<\/p>\n<p>\u5c45\u7136\u76f4\u63a5\u7f16\u8bd1\u8fd0\u884c\u6210\u529f\u4e86&#xff01;<\/p>\n<p>\u8fd9\u4e2a\u53cd\u5dee\u8ba9\u6211\u604d\u7136\u5927\u609f&#xff1a;\u547d\u4ee4\u884c Maven \u53ea\u8ba4 JAVA_HOME&#xff0c;\u53ea\u8981\u6307\u5230 JDK 21 \u5c31\u80fd\u7f16\u8bd1&#xff1b;\u800c IDEA \u7f16\u8bd1\u5931\u8d25&#xff0c;\u8bf4\u660e\u95ee\u9898\u51fa\u5728 IDEA \u672c\u8eab&#xff0c;\u800c\u4e0d\u662f JDK \u6216\u7f16\u8bd1\u914d\u7f6e\u3002<\/p>\n<h4>\u7b2c 4 \u6b65&#xff1a;\u67e5 IDEA \u7248\u672c&#xff0c;\u771f\u76f8\u5927\u767d<\/h4>\n<p>\u53bb\u67e5 IDEA \u7684\u7248\u672c\u53f7\u548c\u7528\u6237\u914d\u7f6e&#xff0c;\u53d1\u73b0&#xff1a;<\/p>\n<ul>\n<li>IDEA \u7248\u672c&#xff1a;IntelliJ IDEA 2021.2&#xff08;2021 \u5e74\u53d1\u5e03&#xff09;<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6 acceptedLanguageLevels.xml \u91cc\u53ea\u63a5\u53d7\u4e86 JDK_17<\/li>\n<\/ul>\n<h3>\u4e09\u3001\u6839\u56e0\u5206\u6790<\/h3>\n<p>\u4e00\u53e5\u8bdd\u603b\u7ed3&#xff1a;<\/p>\n<p>IntelliJ IDEA 2021.2 \u6700\u9ad8\u53ea\u652f\u6301 Java 17&#xff0c;\u800c Java 21 \u662f 2023 \u5e74 9 \u6708\u624d\u53d1\u5e03\u7684&#xff0c;\u8fd9\u4e2a\u8001\u7248\u672c IDEA \u6839\u672c\u4e0d\u8ba4\u8bc6 Java 21\u3002<\/p>\n<p>\u8fd9\u5b8c\u7f8e\u89e3\u91ca\u4e86\u4e4b\u524d\u7684\u6240\u6709\u602a\u73b0\u8c61&#xff1a;<\/p>\n<table>\n<tr>\u73b0\u8c61\u539f\u56e0<\/tr>\n<tbody>\n<tr>\n<td>\u300cbytecode version \u4e0b\u62c9\u6700\u9ad8\u53ea\u6709 17\u300d<\/td>\n<td>2021.2 \u6700\u9ad8\u5c31\u652f\u6301 17<\/td>\n<\/tr>\n<tr>\n<td>\u62a5 -source 16<\/td>\n<td>2021.2 \u4e0d\u8ba4\u8bc6 21&#xff0c;\u7f16\u8bd1\u5668 fallback \u5230\u4e86\u4f4e\u7248\u672c<\/td>\n<\/tr>\n<tr>\n<td>\u624b\u52a8\u6539 compiler.xml \u6210 21 \u4e5f\u6ca1\u7528<\/td>\n<td>2021.2 \u7684\u7f16\u8bd1\u5668\u538b\u6839\u8bfb\u4e0d\u61c2 21<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>IntelliJ IDEA \u4ece 2023.3 \u8d77\u624d\u6b63\u5f0f\u652f\u6301 Java 21&#xff0c;2021.2 \u5dee\u4e86\u6574\u6574\u4e24\u5e74&#xff0c;\u5c5e\u4e8e\u786c\u6027\u4e0d\u652f\u6301&#xff0c;\u914d\u7f6e\u5c42\u9762\u600e\u4e48\u6539\u90fd\u6ca1\u7528\u3002<\/p>\n<h3>\u56db\u3001\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u65b9\u6848 A&#xff1a;\u5347\u7ea7 IDEA&#xff08;\u4e00\u52b3\u6c38\u9038&#xff0c;\u63a8\u8350&#xff09;<\/h4>\n<ul>\n<li>\u4e0b\u8f7d\u65b0\u7248 IDEA&#xff08;2023.3 \u53ca\u4ee5\u4e0a&#xff0c;\u5efa\u8bae\u76f4\u63a5\u6700\u65b0\u7248&#xff09;<\/li>\n<li>\u5b98\u7f51&#xff1a;https:\/\/www.jetbrains.com\/idea\/download\/<\/li>\n<li>\u65b0\u7248\u548c\u65e7\u7248\u53ef\u4ee5\u5171\u5b58&#xff08;\u5b89\u88c5\u76ee\u5f55\u3001\u914d\u7f6e\u76ee\u5f55\u90fd\u72ec\u7acb&#xff09;&#xff0c;\u4e0d\u5f71\u54cd\u8001\u9879\u76ee<\/li>\n<\/ul>\n<h4>\u65b9\u6848 B&#xff1a;\u547d\u4ee4\u884c Maven \u7f16\u8bd1&#xff08;\u4e34\u65f6\u65b9\u6848&#xff09;<\/h4>\n<p>\u5982\u679c\u6682\u65f6\u4e0d\u60f3\u5347\u7ea7 IDE&#xff0c;\u7528\u547d\u4ee4\u884c\u4e5f\u80fd\u8dd1&#xff1a;<\/p>\n<p><span class=\"token variable\">$env<\/span>:JAVA_HOME &#061; <span class=\"token string\">&#034;D:\\\\develop\\\\Java\\\\jdk-21&#034;<\/span><br \/>\n<span class=\"token variable\">$env<\/span>:Path &#061; <span class=\"token string\">&#034;<span class=\"token variable\">$env<\/span>:JAVA_HOME\\\\bin;&#034;<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token variable\">$env<\/span>:Path<br \/>\ncd \u4f60\u7684\u9879\u76ee\u76ee\u5f55<br \/>\nmvn spring-boot:run<\/p>\n<p>\u7f3a\u70b9\u662f\u5c11\u4e86 IDE \u7684\u65ad\u70b9\u8c03\u8bd5\u7b49\u4fbf\u5229\u3002<\/p>\n<h3>\u4e94\u3001\u603b\u7ed3&#xff1a;\u8fd9\u7c7b\u95ee\u9898\u600e\u4e48\u5feb\u901f\u5b9a\u4f4d<\/h3>\n<p>\u9047\u5230\u300c\u4ee3\u7801\u7528\u4e86\u65b0\u7248 Java \u8bed\u6cd5&#xff0c;\u4f46 IDE \u62a5 -source \u4f4e\u7248\u672c\u300d\u65f6&#xff0c;\u6309\u4e0b\u9762\u987a\u5e8f\u6392\u67e5&#xff0c;\u80fd\u5c11\u8d70\u5f88\u591a\u5f2f\u8def&#xff1a;<\/p>\n<li>\u67e5 JDK \u7248\u672c&#xff1a;java -version&#xff0c;\u786e\u8ba4\u88c5\u4e86\u5bf9\u7684 JDK<\/li>\n<li>\u67e5 IDE \u7248\u672c\u662f\u5426\u652f\u6301\u8fd9\u4e2a JDK&#xff08;\u5173\u952e&#xff01;\u5f88\u591a\u4eba\u6f0f\u4e86\u8fd9\u6b65&#xff09;<\/li>\n<li>\u518d\u67e5\u7f16\u8bd1\u8bbe\u7f6e&#xff1a;Project SDK \/ Language level \/ bytecode version<\/li>\n<p>\u6211\u5f53\u65f6\u8df3\u8fc7\u4e86\u7b2c 2 \u6b65&#xff0c;\u76f4\u63a5\u4ece\u7b2c 1 \u6b65\u8df3\u5230\u7b2c 3 \u6b65&#xff0c;\u7ed3\u679c\u5728\u7f16\u8bd1\u8bbe\u7f6e\u91cc\u7ed5\u4e86\u4e00\u4e2a\u591a\u5c0f\u65f6\u3002<\/p>\n<p>\u6838\u5fc3\u6559\u8bad&#xff1a;Java 21 \u8fd9\u6837\u7684\u65b0\u7248\u672c&#xff0c;\u9664\u4e86 JDK \u672c\u8eab&#xff0c;\u4f60\u7684 IDE\u3001Maven\u3001\u6784\u5efa\u63d2\u4ef6\u90fd\u8981\u914d\u5957\u652f\u6301&#xff0c;\u7f3a\u4e00\u4e0d\u53ef\u3002\u6392\u67e5\u65f6\u522b\u53ea\u76ef\u7740\u4e00\u4e2a\u73af\u8282\u3002<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u6b21\u300cJava 21 \u9879\u76ee\u7f16\u8bd1\u62a5\u9519\u300d\u7684\u5b8c\u6574\u6392\u67e5\u8bb0\u5f55&#xff0c;\u5e0c\u671b\u5e2e\u540e\u6765\u8005\u5c11\u8d70\u5f2f\u8def\u3002\u4e00\u3001\u95ee\u9898\u73b0\u8c61<br \/>\n\u6211\u65b0\u5efa\u4e86\u4e00\u4e2a Java 21 &#xff08;\u7b2c\u4e00\u6b21\u4f7f\u7528&#xff09;\u7684 Spring Boot \u9879\u76ee&#xff0c;\u7528 IDEA \u6253\u5f00\u540e\u7f16\u8bd1\u62a5\u9519&#xff1a;<br \/>\njava: -source 16 \u4e2d\u4e0d\u652f\u6301 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f<br \/>\n&#xff08;\u8bf7\u4f7f\u7528 -source 21 \u6216\u66f4\u9ad8\u7248\u672c\u4ee5\u542f\u7528 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f&#xff09;\u62a5\u9519\u5b9a\u4f4d\u5230\u4e00\u884c\u7528\u4e86 Java 21<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[70,386,99],"topic":[],"class_list":["post-94230","post","type-post","status-publish","format-standard","hentry","category-server","tag-ide","tag-intellij-idea","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/94230.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u6b21\u300cJava 21 \u9879\u76ee\u7f16\u8bd1\u62a5\u9519\u300d\u7684\u5b8c\u6574\u6392\u67e5\u8bb0\u5f55&#xff0c;\u5e0c\u671b\u5e2e\u540e\u6765\u8005\u5c11\u8d70\u5f2f\u8def\u3002\u4e00\u3001\u95ee\u9898\u73b0\u8c61 \u6211\u65b0\u5efa\u4e86\u4e00\u4e2a Java 21 &#xff08;\u7b2c\u4e00\u6b21\u4f7f\u7528&#xff09;\u7684 Spring Boot \u9879\u76ee&#xff0c;\u7528 IDEA \u6253\u5f00\u540e\u7f16\u8bd1\u62a5\u9519&#xff1a; java: -source 16 \u4e2d\u4e0d\u652f\u6301 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f &#xff08;\u8bf7\u4f7f\u7528 -source 21 \u6216\u66f4\u9ad8\u7248\u672c\u4ee5\u542f\u7528 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f&#xff09;\u62a5\u9519\u5b9a\u4f4d\u5230\u4e00\u884c\u7528\u4e86 Java 21\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/94230.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-13T16:18:05+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94230.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/94230.html\",\"name\":\"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-13T16:18:05+00:00\",\"dateModified\":\"2026-08-13T16:18:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/94230.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/94230.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/94230.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/94230.html","og_locale":"zh_CN","og_type":"article","og_title":"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u6b21\u300cJava 21 \u9879\u76ee\u7f16\u8bd1\u62a5\u9519\u300d\u7684\u5b8c\u6574\u6392\u67e5\u8bb0\u5f55&#xff0c;\u5e0c\u671b\u5e2e\u540e\u6765\u8005\u5c11\u8d70\u5f2f\u8def\u3002\u4e00\u3001\u95ee\u9898\u73b0\u8c61 \u6211\u65b0\u5efa\u4e86\u4e00\u4e2a Java 21 &#xff08;\u7b2c\u4e00\u6b21\u4f7f\u7528&#xff09;\u7684 Spring Boot \u9879\u76ee&#xff0c;\u7528 IDEA \u6253\u5f00\u540e\u7f16\u8bd1\u62a5\u9519&#xff1a; java: -source 16 \u4e2d\u4e0d\u652f\u6301 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f &#xff08;\u8bf7\u4f7f\u7528 -source 21 \u6216\u66f4\u9ad8\u7248\u672c\u4ee5\u542f\u7528 switch \u8bed\u53e5\u4e2d\u7684\u6a21\u5f0f&#xff09;\u62a5\u9519\u5b9a\u4f4d\u5230\u4e00\u884c\u7528\u4e86 Java 21","og_url":"https:\/\/www.wsisp.com\/helps\/94230.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-13T16:18:05+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/94230.html","url":"https:\/\/www.wsisp.com\/helps\/94230.html","name":"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-13T16:18:05+00:00","dateModified":"2026-08-13T16:18:05+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/94230.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/94230.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/94230.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"IDEA \u62a5 `-source 16 \u4e0d\u652f\u6301 switch \u6a21\u5f0f\u5339\u914d`\uff1f\u53ef\u80fd\u662f\u4f60\u7684 IDEA \u7248\u672c\u592a\u8001\u4e86"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/94230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=94230"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/94230\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=94230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=94230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=94230"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=94230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}