{"id":291090,"date":"2024-04-24T21:40:36","date_gmt":"2024-04-24T13:40:36","guid":{"rendered":"https:\/\/lrxjmw.cn\/lhjxjazyhjbl.html"},"modified":"2024-04-24T21:40:36","modified_gmt":"2024-04-24T13:40:36","slug":"lhjxjazyhjbl","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lhjxjazyhjbl.html","title":{"rendered":"Linux\u73af\u5883\u4e0bJDK\u5b89\u88c5\u4e0e\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\uff1a\u5efa\u7acb\u9ad8\u6548Java\u5f00\u53d1\u73af\u5883\u7684\u5173\u952e\u6b65\u9aa4"},"content":{"rendered":"

\u5728\u9ad8\u7ea7\u7cfb\u7edf<\/a>\u7ba1\u7406\u4eba\u5458\u773c\u4e2d\uff0c\u719f\u7a14Linux<\/a>\u73af\u5883\u4e0b\u7684JDK\u5b89\u88c5\u53ca\u73af\u5883\u53d8\u91cf<\/a>\u8bbe\u7f6e\u5bf9\u6b63\u786e\u4f7f\u7528Java\u5f00\u53d1\u73af\u5883\u6781\u4e3a\u5173\u952e\u3002\u672c\u7bc7\u6587\u7ae0\u5c06\u8be6\u5c3d\u63cf\u8ff0Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0aJDK\u7684\u5177\u4f53\u5b89\u88c5\u6b65\u9aa4\u548c\u73af\u5883\u53d8\u91cf\u8c03\u6574\u6280\u5de7\uff0c\u5e76\u7a81\u51fa\u5176\u4e2d\u5173\u952e\u70b9\uff0c\u4ee5\u52a9\u4f60\u5feb\u901f\u5efa\u7acb\u9ad8\u6548\u4e14\u9002\u7528\u7684Java\u5f00\u53d1\u73af\u5883\u3002<\/p>\n

1.JDK\u7b80\u4ecb\u4e0e\u91cd\u8981\u6027<\/b><\/p>\n

\u5bf9JDK\u7684\u6df1\u5ea6\u7406\u89e3\u548c\u7cbe\u786e\u638c\u63a7\uff0c\u4ee5\u53ca\u5b83\u5728Java\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u7684\u6838\u5fc3\u5730\u4f4d\uff0c\u662f\u6bcf\u4e00\u4e2aJava\u5f00\u53d1\u8005\u7684\u5fc5\u4fee\u529f\u8bfe\u3002\u4f5c\u4e3aJava\u5f00\u53d1\u7684\u5fc5\u5907\u6b66\u5668\uff0cJDK\u5305\u542b\u4e86Java\u8fd0\u884c\u73af\u5883\uff08JRE\uff09\u548c\u4e30\u5bcc\u7684\u5b9e\u7528\u5de5\u5177\u4e0e\u57fa\u7840\u7c7b\u5e93\uff08JavaAPI\uff09\u7b49\u91cd\u8981\u7ec4\u4ef6\uff0c\u88ab\u8a89\u4e3aJava\u5f00\u53d1\u7684\u57fa\u77f3\u3002<\/p>\n

\u4e3a\u4e86\u786e\u4fddJava\u5f00\u53d1\u7684\u987a\u5229\u8fdb\u884c\uff0c\u9996\u8981\u4efb\u52a1\u662f\u5728Linux\u73af\u5883\u4e2d\u7cbe\u786e\u5730\u88c5\u8f7d\u548c\u8c03\u8bd5JDK\u3002\u501f\u52a9\u8be5\u5de5\u5177\uff0c\u53ef\u5728Linux\u7cfb\u7edf\u57fa\u7840\u4e0a\u7f16\u5199\u3001\u7f16\u8bd1\u4ee5\u53ca\u6267\u884cJava\u7a0b\u5e8f\uff0c\u4ece\u800c\u6784\u5efa\u8de8\u5e73\u53f0\u7684\u5e94\u7528linux jdk\u5b89\u88c5\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/strong>\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u5e76\u589e\u5f3a\u5e94\u7528\u7684\u53ef\u79fb\u690d\u6027\u3002<\/p>\n

2.JDK\u5b89\u88c5\u65b9\u6cd5<\/b><\/p>\n

\u672c\u6587\u8be6\u5c3d\u9610\u8ff0\u4e86\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5JavaDevelopmentKit\uff08\u7b80\u79f0JDK\uff09\u7684\u4e24\u79cd\u9014\u5f84\uff1a\u624b\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4ee5\u53ca\u501f\u52a9\u7cfb\u7edf\u81ea\u5e26\u7684\u5305\u7ba1\u7406\u5668\u8fdb\u884c\u81ea\u52a8\u5b89\u88c5\u3002\u5177\u4f53\u6b65\u9aa4\u8be6\u89c1\u4e0b\u6587\u3002<\/p>\n

2.1\u624b\u52a8\u5b89\u88c5<\/b><\/p>\n

\u624b\u52a8\u5b89\u88c5\u4e43\u5e38\u7528\u65b9\u6cd5\u4e4b\u4e00\uff0c\u5176\u4e3b\u8981\u6d41\u7a0b\u5728\u4e8e\uff1a\u9996\u5148\uff0c\u4ece\u5b98\u65b9\u6e20\u9053\u83b7\u53d6\u6700\u65b0\u7684OracleJDK\u6216OpenJDK\u5b89\u88c5\u7a0b\u5e8f\uff1b\u5176\u6b21\uff0c\u6309\u7167\u8be6\u7ec6\u6307\u5357\u5b8c\u6210\u89e3\u538b\u7f29\u53ca\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7b49\u76f8\u5173\u6b65\u9aa4\u3002<\/p>\n

2.2\u4f7f\u7528\u5305\u7ba1\u7406\u5668<\/b><\/p>\n

\u4f7f\u7528\u4efb\u610f\u64cd\u4f5c\u7cfb\u7edf\u5185\u5d4c\u7684\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u7686\u80fd\u5feb\u901f\u51c6\u786e\u5730\u5b9e\u73b0JDK\u7684\u5b89\u88c5\u8fc7\u7a0b\u3002\u5f53\u524d\u5927\u90e8\u5206\u4e3b\u8981Linux\u53d1\u884c\u7248\u7686\u56ca\u62ec\u4e86\u76f8\u5e94\u7684JDK\u5957\u4ef6\uff0c\u4ec5\u9700\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u76f8\u5173\u547d\u4ee4<\/a>\uff08\u5982apt\u6216yum\uff09\uff0c\u4fbf\u80fd\u8f7b\u677e\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

3.\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/b><\/p>\n

\u6210\u529f\u90e8\u7f72JDK\u4e4b\u540e\uff0c\u4e3a\u4e86\u786e\u4fdd\u957f\u671f\u4f7f\u7528\uff0c\u52a1\u5fc5\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u3002\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u5173\u952e\u64cd\u4f5c\uff1a<\/p>\n

3.1\u914d\u7f6eJAVA_HOME<\/b><\/p>\n

\u4e3a\u51c6\u786e\u6307\u5b9aJava\u8fd0\u884c\u73af\u5883\u7684\u5177\u4f53\u8def\u5f84\uff0c\u7279\u8bbeJAVA_HOME\u4e3a\u4e13\u7528\u73af\u5883\u53d8\u91cf\u3002\u5728\u5b9e\u9645\u8bbe\u7f6e\u8fc7\u7a0b\u4e2d\uff0c\u52a1\u5fc5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\u4ee5\u4fdd\u8bc1\u52a8\u6001\u94fe\u63a5\u5e93\u53c2\u6570\u8bbe\u5b9a\u7684\u6b63\u786e\u6027:<\/p>\n

```<\/p>\n

\u5efa\u8bae\u5c06JAVA_HOME\u73af\u5883\u53d8\u91cf\u8bbe\u5b9a\u4e3a\"\/usr\/lib\/jvm\/java-11-openjdk-amd64\"\u3002<\/p>\n

3.2\u914d\u7f6ePATH<\/b><\/p>\n

PATH\u73af\u5883\u53d8\u91cf\u7528\u4e8e\u786e\u7acb\u64cd\u4f5c\u7cfb\u7edf\u67e5\u627e\u5e76\u6267\u884c\u547d\u4ee4\u7684\u8def\u5f84\u3002\u4e3a\u4fdd\u8bc1Java\u6307\u4ee4\u53ca\u76f8\u5173\u5de5\u5177\u80fd\u8fc5\u901f\u627e\u5230\u5e76\u4f7f\u7528\uff0cJDK\u7684bin\u76ee\u5f55\u5e94\u88ab\u5217\u5165PATH\u5217\u8868\u4e2d\u3002\u4f8b\u5982\uff1a<\/p>\n

\u901a\u8fc7\u5c06$JAVA_HOME\u4e8c\u7ea7\u76ee\u5f55\u4e0b\u7684\"bin\"\u8def\u5f84\u4f5c\u4e3a\u73af\u5883\u53d8\u91cf$PATH\u7684\u65b0\u589e\u90e8\u5206\uff0c\u53ef\u5b8c\u6210\u7cbe\u7ec6\u5316\u914d\u7f6e\u548c\u9ad8\u6548\u90e8\u7f72\u3002<\/p>\n

3.3\u914d\u7f6eCLASSPATH\uff08\u53ef\u9009\uff09<\/b><\/p>\n

CLASSPATH\u4e3aJava\u7f16\u8bd1\u548c\u865a\u62df\u73af\u5883\u67e5\u627e\u7c7b\u5e93\u6240\u5fc5\u9700\uff0c\u6545\u4e00\u822c\u65e0\u9700\u624b\u52a8\u8bbe\u5b9a\u3002\u4ec5\u5728\u7279\u5b9a\u9700\u6c42\u6216\u5f15\u5165\u7b2c\u4e09\u65b9\u5e93\u65f6\u624d\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n

\u5728\u9002\u5f53\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u540e\uff0c\u65e0\u8bba\u8eab\u5904\u4f55\u5904\uff0c\u90fd\u80fd\u987a\u7545\u6267\u884c\u6240\u6709Java\u76f8\u5173\u547d\u4ee4\u548c\u5de5\u5177\u3002\u6b64\u4e3e\u514d\u9664\u4e86\u660e\u786e\u5b9a\u4e49JDK\u5b89\u88c5\u8def\u5f84\u7684\u56f0\u6270\uff0c\u6781\u5927\u63d0\u5347\u4e86Java\u5e94\u7528\u5f00\u53d1\u548c\u64cd\u4f5c\u6548\u7387\u3002<\/p>\n

4.\u6ce8\u610f\u4e8b\u9879\u4e0e\u5e38\u89c1\u95ee\u9898<\/b><\/p>\n

\u5728\u914d\u7f6e\u548c\u5b9e\u65bdJavaDevelopmentKit(JDK)\u65f6\uff0c\u4ee5\u4e0b\u662f\u51e0\u4e2a\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u76f8\u5e94\u5bf9\u7b56\u3002<\/p>\n

4.1\u7248\u672c\u9009\u62e9<\/b><\/p>\n

\u5b9e\u9645\u8fd0\u7528\u65f6\u9700\u6839\u636e\u7279\u5b9a\u9700\u6c42\u4e0e\u9879\u76ee\u89c4\u683c\u6311\u9009\u9002\u5f53\u7684JDK\u7248\u672c\u3002\u9274\u4e8e\u6700\u65b0\u7684\u7a33\u5b9a\u7248\u80fd\u591f\u517c\u987e\u6548\u7387\u63d0\u5347\u53ca\u5b89\u5168\u4fdd\u969c\uff0c\u56e0\u6b64\u88ab\u4f5c\u4e3a\u9996\u9009\u3002<\/p>\n

4.2\u5b89\u5168\u6027\u4e0e\u6743\u9650<\/b><\/p>\n

\u5728\u6267\u884cJavaDevelopmentKit\uff08JDK\uff09\u7684\u5b89\u88c5\u4e0e\u914d\u7f6e\u65f6\uff0c\u52a1\u5fc5\u614e\u91cd\u5bf9\u5f85\u6587\u4ef6\u6743\u9650\u53ca\u5b89\u5168\u8bbe\u7f6e\uff0c\u4ec5\u6388\u6743\u62e5\u6709\u5fc5\u8981\u6743\u9650\u7684\u7528\u6237\u5bf9\u76f8\u5173\u6587\u4ef6\u8fdb\u884c\u8bbf\u95ee\u548c\u4fee\u6539\uff0c\u4ee5\u514d\u53d7\u5230\u6f5c\u5728\u6076\u610f\u653b\u51fb\u6216\u9ed1\u5ba2\u5165\u4fb5\u3002<\/p>\n

4.3\u914d\u7f6e\u68c0\u67e5\u4e0e\u8c03\u8bd5<\/b><\/p>\n

\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u9700\u8fdb\u884c\u4e25\u683c\u68c0\u67e5\u4e0e\u8c03\u8bd5linux\u5f00\u6e90\u8f6f\u4ef6\uff0c\u786e\u4fdd\u8bbe\u7f6e\u53ef\u6b63\u5e38\u8fd0\u884c\u3002\u6b64\u65f6\uff0c\u53ef\u4f7f\u7528\u5982java\u6216javac\u7b49\u6307\u4ee4\u68c0\u9a8c\u5176\u6548\u679c\u3002<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u8bbe\u7f6ejdk_linux\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u6587\u4ef6_linux jdk\u5b89\u88c5\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/p>\n

\u5173\u6ce8\u5173\u952e\u73af\u8282\uff0c\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\uff0c\u4fdd\u8bc1JDK\u987a\u5229\u5b89\u88c5\u4e0e\u914d\u7f6e\u4f18\u5316\u5b8c\u6bd5\uff0c\u6784\u5efaJava\u5f00\u53d1\u6240\u9700\u7a33\u5b9a\u73af\u5883\u3002<\/p>\n

5.\u603b\u7ed3\u4e0e\u5c55\u671b<\/b><\/p>\n

\u672c\u6307\u5357\u65e8\u5728\u8be6\u7ec6\u8bb2\u89e3Linux\u4e0b\u9ad8\u6548\u914d\u7f6eJDK\u73af\u5883linux\u5b89\u88c5\u6559\u7a0b\uff0c\u4ee5\u63d0\u9ad8Java\u7f16\u7a0b\u6548\u7387\u5e76\u63d0\u5347\u9879\u76ee\u8d28\u91cf\u3002<\/p>\n

\u79d1\u6280\u65e5\u65b0\u6708\u5f02\u5730\u53d1\u5c55\uff0c\u867d\u7136JDK\u90e8\u7f72\u65b9\u6848\u53ef\u80fd\u4f1a\u6709\u8c03\u6574\u66f4\u65b0linux jdk\u5b89\u88c5\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/strong>\uff0c\u4f46\u5176\u6838\u5fc3\u539f\u7406\u548c\u6d41\u7a0b\u4ecd\u7136\u7a33\u56fa\u4e0d\u53d8\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u9700\u8981\u5bc6\u5207\u5173\u6ce8\u79d1\u6280\u7684\u52a8\u6001\uff0c\u6df1\u5165\u7406\u89e3\u638c\u63e1\uff0c\u624d\u80fd\u5728\u6fc0\u70c8\u7684\u5e02\u573a\u7ade\u4e89\u4e2d\u7acb\u8db3\u5e76\u7cbe\u8fdb\u6280\u672f\u5b9e\u529b\u3002<\/p>\n

\u8bda\u9080\u5404\u4f4d\u7545\u8c08\u5bf9JDK\u5b89\u88c5\u4e0e\u914d\u7f6e\u76f8\u5173\u95ee\u9898\u7684\u56f0\u60d1\u53ca\u89e3\u51b3\u7b56\u7565\u3002\u656c\u8bf7\u5c06\u4e2a\u4eba\u7ecf\u9a8c\u548c\u72ec\u7279\u89c2\u70b9\u7559\u4e8e\u8bc4\u8bba\u533a\u5171\u4eab\uff0c\u671f\u5f85\u5171\u540c\u63a2\u8ba8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6210\u529f\u90e8\u7f72JDK\u4e4b\u540e\uff0c\u4e3a\u4e86\u786e\u4fdd\u957f\u671f\u4f7f\u7528\uff0c\u52a1\u5fc5\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u3002\u901a\u8fc7\u5c06$JAVA_HOME\u4e8c\u7ea7\u76ee\u5f55\u4e0b\u7684bin\u8def\u5f84\u4f5c\u4e3a\u73af\u5883\u53d8\u91cf$PATH\u7684\u65b0\u589e\u90e8\u5206\uff0c\u53ef\u5b8c\u6210\u7cbe\u7ec6\u5316\u914d\u7f6e\u548c\u9ad8\u6548\u90e8\u7f72\u3002\u5173\u6ce8\u5173\u952e\u73af\u8282\uff0c\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\uff0c\u4fdd\u8bc1JDK\u987a\u5229\u5b89\u88c5\u4e0e\u914d\u7f6e\u4f18\u5316\u5b8c\u6bd5\uff0c\u6784\u5efaJava\u5f00\u53d1\u6240\u9700\u7a33\u5b9a\u73af\u5883\u3002<\/p>\n","protected":false},"author":1,"featured_media":291091,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-291090","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\/291090","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=291090"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291090\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/291091"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=291090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=291090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=291090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}