{"id":264222,"date":"2023-02-16T22:10:14","date_gmt":"2023-02-16T14:10:14","guid":{"rendered":"https:\/\/lrxjmw.cn\/jazzysxjbmys.html"},"modified":"2023-02-16T22:10:14","modified_gmt":"2023-02-16T14:10:14","slug":"jazzysxjbmys","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/jazzysxjbmys.html","title":{"rendered":"Java\u5b89\u88c5\u6ce8\u610f\u4e8b\u9879\u57fa\u672c\u6ca1\u6709\u4ec0\u4e48\u4e0d\u540c\u65b9\u6cd5\u4ecb\u7ecd\u53ca\u5b89\u88c5\u65b9\u6cd5"},"content":{"rendered":"

\u4e00\u3001Java\u5b89\u88c5\u6ce8\u610f\u4e8b\u9879<\/p>\n

\u6709\u597d\u591a\u4e0d\u540c\u7684Java\u5b9e\u73b0\u3002OpenJDK\u548cOracleJava\u662f\u6700\u4e3b\u8981\u7684\u4e24\u4e2aJava\u5b9e\u73b0\uff0c\u4e0d\u4ec5OracleJava\u62e5\u6709\u5f88\u5c11\u7684\u4e00\u4e9b\u989d\u5916\u7279\u70b9\u4e4b\u5916\uff0c\u5b83\u4eec\u4e24\u4e2a\u57fa\u672c\u6ca1\u6709\u54ea\u4e9b\u4e0d\u540c\u3002OracleJava\u6388\u6743\u4ec5\u4ec5\u5bb9\u8bb8\u4f5c\u4e3a\u975e\u5546\u4e1a\u8f6f\u4ef6\u7684\u4f7f\u7528\uff0c\u6bd4\u5982\uff1a\u4e2a\u4eba\u7528\u9014\u548c\u5f00\u53d1\u7528\u9014\u3002<\/p>\n

\u9ed8\u8ba4\u7684Ubuntu20.04\u6e90\u5e93\u623f\u5305\u542b\u4e86\u4e24\u4e2aOpenJDK\u8f6f\u4ef6\u5305\uff0c,JavaRuntimeEnvironment(JRE)\u548cJavaDevelopmentKit(JDK)\u3002JRE\u4e3b\u8981\u5305\u542b\u4e86Java\u865a\u62df\u673a\uff08JVM\uff09\uff0c\u7c7b\u548c\u5bb9\u8bb8\u4f60\u8fd0\u884cJava\u7a0b\u5e8f\u7684\u4e8c\u8865\u7801\u5305\u3002JDK\u5305\u542bJRE\u548c\u7528\u4e8e\u5efa\u7acbJava\u5e94\u7528\u7684\u5f00\u53d1\/\u8c03\u8bd5\u5de5\u5177\u548c\u5e93\u6587\u4ef6\u3002<\/p>\n

\u5047\u5982\u4f60\u4e0d\u786e\u5b9a\u8981\u5b89\u88c5\u54ea\u4e00\u4e2a\u7248\u672c\u7684Java\uff0c\u6211\u4eec\u4e00\u822c\u63a8\u8350\u5b89\u88c5OpenJDK(JDK11)\u7248\u672c\u3002\u4e00\u4e9b\u57fa\u4e8eJava\u7684\u5e94\u7528\u53ef\u80fd\u987b\u8981\u8fd0\u884c\u5728\u6307\u5b9a\u7684Java\u7248\u672c\u4e0b\uff0c\u4f60\u5e94\u5f53\u67e5\u9605\u5e94\u7528\u6587\u6863\u3002<\/p>\n

\u4e8c\u3001\u5728ubuntu20.4\u4e2d\u5b89\u88c5java-jdk11<\/p>\n

\u65b9\u5f0f1\uff1a\u901a\u8fc7\u7ec8\u7aef\u547d\u4ee4<\/a>\u884c\u5b89\u88c5<\/p>\n

openjdk11\u662fJava\u7684\u4e00\u4e2a\u5e38\u5e74\u652f\u6301\u7248\u672c\uff08LTS\uff09\u3002\u5b83\u540c\u65f6\u4e5f\u662fUbuntu20.04\u7684\u9ed8\u8ba4Java\u5f00\u53d1\u548c\u8fd0\u884c\u73af\u5883\u3002<\/p>\n

\u4ee5root\u6216\u5219\u5176\u4ed6sudo\u6743\u9650\u7528\u6237\u8eab\u5206\u8fd0\u884c\u4e0b\u8fb9\u7684\u547d\u4ee4\uff0c\u66f4\u65b0\u8f6f\u4ef6\u5305\u7d22\u5f15\uff0c\u4f46\u662f\u5b89\u88c5OpenJDK11JDK\u8f6f\u4ef6\u5305\uff1a<\/p>\n

linux\u7cfb\u7edfjdk\u7684\u5b89\u88c5\u548c\u914d\u7f6e_jdk\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e linux_linux jdk16\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/p>\n

\u5728Ubuntu\u547d\u4ee4\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

sudoaptupdate<\/p>\n

sudoaptinstallopenjdk-11-jdk<\/p>\n

\u6ce8\u610f\u6211\u4e0d\u592a\u5efa\u8bae\u901a\u8fc7\u89e3\u538b\u538b\u7f29\u5305.jar.gz.\u7684\u5f62\u5f0f\u8fdb\u884c\u5b89\u88c5linux vi\uff0c\u7531\u4e8e\u5728\u540e\u7eed\u7684\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u8fc7\u7a0b\u4e2d\u5f88\u5bb9\u6613\u51fa\u9519\uff08\u9519\u8bef\u5982\u53f3\u56fe1-1\u6240\u793a\uff1a\uff09linux apache \u865a\u62df\u4e3b\u673a\uff0c\u8fd9\u4e2a\u914d\u7f6e\u8fc7\u7a0b\u968fUbuntu\u548cjdk\u7684\u7248\u672c\u4e0d\u4e00\u6837\u6240\u914d\u7f6e\u7684\u65b9\u5f0f\u4e5f\u6709\u6240\u533a\u522b<\/p>\n

\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0<\/p>\n

\u56fe1-1\u9a8c\u8bc1jdk\u73af\u5883\u662f\u5426\u6210\u529f\u3002<\/p>\n

\u5f53\u6211\u4eec\u5b89\u88c5\u5b8c\u6210\u4e4b\u540elinux jdk16\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/strong>\uff0c\u5728\u7ec8\u7aef\u8f93\u5165java-version\u6765\u6d4b\u8bd5\u5b89\u88c5\u53ca\u73af\u5883\u53d8\u91cf\u662f\u5426\u914d\u7f6e\u6210\u529f<\/p>\n

\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0<\/p>\n

jdk\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e linux_linux jdk16\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e_linux\u7cfb\u7edfjdk\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/p>\n

\u663e\u793a\u5df2\u7136\u6210\u529f\u5b89\u88c5\u5e76\u914d\u7f6e\u6210\u529f\uff0copenjdk-11.0.11<\/p>\n

\u65b9\u5f0f2\uff1a\u81ea\u52a8\u4e0b\u8f7d\u538b\u7f29\u5305\u5b89\u88c5oracleJavaJDK<\/p>\n

1\u3001\u524d\u5f80oracleJava\u5b98\u7f51\u4e0b\u8f7dJDK\uff09<\/p>\n

jdk\u5b98\u7f51\uff1a<\/p>\n

2\u3001\u89e3\u538b\u7f29\u5230\u6307\u5b9a\u76ee\u5f55\uff08\u4ee5jdk-11.01_linux-x64_bin.tar.gz\u4e3a\u4f8b\uff09<\/p>\n

\u9996\u9009\u5728\u7ec8\u7aef\u547d\u4ee4\u884c\u521b\u5efa\u4f60\u8981\u5b89\u88c5\u7684\u76ee\u5f55<\/p>\n

\u4e4b\u540e\u5c06\u81ea\u5df1\u5728\u5b98\u7f51\u4e0b\u8f7d\u7684JDK\u6587\u4ef6\u89e3\u538b\u5230\u4f60\u6240\u521b\u5efa\u7684\u76ee\u5f55<\/p>\n

linux jdk16\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e_jdk\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e linux_linux\u7cfb\u7edfjdk\u7684\u5b89\u88c5\u548c\u914d\u7f6e<\/p>\n

\u89e3\u538b\u5b8c\u6210\u540e\u5982\u56fe\uff1a<\/p>\n

3.\u914d\u7f6e\u7cfb\u7edf<\/a>\u73af\u5883\u53d8\u91cf<\/p>\n

\u5728\u7ec8\u7aef\u547d\u4ee4\u884c\u8f93\u5165sudovi\/etc\/profile\uff0c\u6253\u5f00\u914d\u7f6e\u6587\u4ef6<\/p>\n

\u5728\u6587\u4ef6\u672b\u5c3e\u52a0\u5165<\/p>\n

JAVA_HOME=\/linux\/java\/jdk-11.0.11#\u914d\u7f6e\u5185\u5bb9<\/p>\n

CLASSPATH=.<\/p>\n

PATH=JAVAHOME\/bin:JAVA_HOME\/bin:JAVAH\u200bOME\/bin:PATH<\/p>\n

exportJAVA_HOMECLASSPATHPATH<\/p>\n

#\u4f7f\u66f4\u6539\u7684\u914d\u7f6e\u751f\u6548<\/p>\n

source\/etc\/profilec<\/p>\n

\u4fdd\u5b58\u540e\u9000\u51fa\u3002<\/p>\n

\u5728\u8f93\u5165java-version\u67e5\u770b\u73af\u5883\u53d8\u91cf\u662f\u5426\u914d\u7f6e\u6210\u529f\u3002<\/p>\n

\u4e09\u3001\u8bbe\u7f6e\u9ed8\u8ba4\u7248\u672c<\/p>\n

\u5047\u5982\u4f60\u5728\u4f60\u7684Ubuntu\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86\u591a\u4e2aJava\u7248\u672clinux jdk16\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/strong>\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u4e0b\u8fb9\u7684\u547d\u4ee4\uff0c\u68c0\u67e5\u90a3\u4e2a\u7248\u672c\u88ab\u8bbe\u7f6e\u6210\u4e86\u9ed8\u8ba4\u503c\uff1a<\/p>\n

java-version<\/p>\n

\u60f3\u8981\u66f4\u6539\u9ed8\u8ba4\u7684\u7248\u672c\uff0c\u4f7f\u7528update-alternatives\u547d\u4ee4\uff1a<\/p>\n

sudoupdate-alternatives--configjava<\/p>\n

\u8f93\u51fa\u50cf\u4e0b\u8fb9\u8fd9\u6837\uff1a<\/p>\n

Thereare2choicesforthealternativejava(providing\/usr\/bin\/java).<\/p>\n

SelectionPathPriorityStatus<\/p>\n

Presstokeepthecurrentchoice[*],ortypeselectionnumber:<\/p>\n

**<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e8c\u3001\u5728ubuntu20.openjdk-11-jdk\u9a8c\u8bc1jdk\u73af\u5883\u662f\u5426\u6210\u529f\u3002-version\u6765\u6d4b\u8bd5\u5b89\u88c5\u53ca\u73af\u5883\u53d8\u91cf\u662f\u5426\u914d\u7f6e\u6210\u529f\u663e\u793a\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u5e76\u914d\u7f6e\u6210\u529f\uff0copenjdk-11.2\u3001\u89e3\u538b\u7f29\u5230\u6307\u5b9a\u76ee\u5f55\uff08\u4ee5jdk-11.\u914d\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\/etc\/profile\uff0c\u6253\u5f00\u914d\u7f6e\u6587\u4ef6JAVA_HOME=\/linux\/java\/jdk-11.-version\u67e5\u770b\u73af\u5883\u53d8\u91cf\u662f\u5426\u914d\u7f6e\u6210\u529f\u3002<\/p>\n","protected":false},"author":1,"featured_media":264224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-264222","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=264222"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264222\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/264224"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=264222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=264222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=264222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}