\u547d\u4ee4<\/a>\uff08\u5982apt\u6216yum\uff09\uff0c\u4fbf\u80fd\u8f7b\u677e\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n3.\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
<\/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}]}}