{"id":52440,"date":"2024-12-03T08:16:34","date_gmt":"2024-12-03T00:16:34","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52440\/"},"modified":"2024-12-03T08:16:34","modified_gmt":"2024-12-03T00:16:34","slug":"ubuntu%e4%b9%8bjdk%e5%ae%89%e8%a3%85-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52440\/","title":{"rendered":"Ubuntu\u4e4bjdk\u5b89\u88c5"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Ubuntu\u4e4bjdk\u5b89\u88c5<\/h1>\n<p>IT\u884c\u4e1a\u76f8\u5bf9\u4e8e\u4e00\u822c\u4f20\u7edf\u884c\u4e1a\uff0c\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u66f4\u5feb\uff0c\u4e00\u65e6\u505c\u6b62\u4e86\u5b66\u4e60\uff0c\u5f88\u5feb\u5c31\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8e0f\u8e0f\u5b9e\u5b9e\u7684\u4e0d\u65ad\u5b66\u4e60\uff0c\u7cbe\u8fdb\u81ea\u5df1\u7684\u6280\u672f\uff0c\u5c24\u5176\u662f\u521d\u5b66\u8005\u3002\u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u6574\u7406\u4e86\u300aUbuntu\u4e4bjdk\u5b89\u88c5\u300b\uff0c\u804a\u804a\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01<\/p>\n<p><strong>1.oracle\u5b98\u7f51\u4e0b\u8f7d\u538b\u7f29\u5305<\/strong>  <\/p>\n<p>\u70b9\u51fb\u94fe\u63a5<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d164f0c6.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe\" \/><\/p>\n<p><strong>2.\u89e3\u538b<\/strong>  <\/p>\n<pre> tar -zxvf jdk-8u171-linux-x64.tar.gz\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d1651ec7.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe1\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe1\" \/><\/p>\n<p><strong>3.\u79fb\u52a8\u5230\u5236\u5b9a\u76ee\u5f55<\/strong>  <\/p>\n<p>##\u5c06\u6587\u4ef6\u4ece\u4e0b\u8f7d\u76ee\u5f55 \u632a\u5230\/usr\/local\u4e0b<\/p>\n<pre>sudo mv jdk1.8.0_171  \/usr\/local\/jdk1.8<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d1653a51.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe2\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe2\" \/><\/p>\n<p><strong>4.\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/strong>  <\/p>\n<pre>vim \/etc\/profile<\/pre>\n<p>\u5728\u6587\u4ef6\u672b\u5c3e\u52a0\u5165<\/p>\n<pre>export JAVA_HOME=\/usr\/local\/jdk1.8\nexport JRE_HOME=${JAVA_HOME}\/jre\nexport CLASSPATH=.:${JAVA_HOME}\/lib:${JRE_HOME}\/lib\nexport PATH=.:${JAVA_HOME}\/bin:$PATH\n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d1656aa1.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe3\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe3\" \/><\/p>\n<p>\u5982\u679c\u663e\u793a\u65e0\u6cd5\u4fdd\u5b58\u4fee\u6539\u547d\u4ee4<\/p>\n<pre>sudo vim \/etc\/profile \n<\/pre>\n<p><strong>5.\u4f7f\u914d\u7f6e\u751f\u6548<\/strong>  <\/p>\n<pre>source \/etc\/profile \n<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d165b630.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe4\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe4\" \/><\/p>\n<p><strong>6.\u68c0\u67e5\u662f\u5426\u751f\u6548<\/strong>  <\/p>\n<pre>java -version<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241126\/173260315867456d165f9d9.jpg\" class=\"aligncenter\" title=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe5\" alt=\"Ubuntu\u4e4bjdk\u5b89\u88c5\u63d2\u56fe5\" \/><\/p>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6587\u7ae0\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu\u4e4bjdk\u5b89\u88c5 IT\u884c\u4e1a\u76f8\u5bf9\u4e8e\u4e00\u822c\u4f20\u7edf\u884c\u4e1a\uff0c\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u66f4\u5feb\uff0c\u4e00\u65e6\u505c\u6b62\u4e86\u5b66\u4e60\uff0c\u5f88\u5feb\u5c31\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8e0f\u8e0f\u5b9e\u5b9e\u7684\u4e0d\u65ad\u5b66\u4e60\uff0c\u7cbe\u8fdb\u81ea\u5df1\u7684\u6280\u672f\uff0c\u5c24\u5176\u662f\u521d\u5b66\u8005\u3002\u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u6574\u7406\u4e86\u300aUbuntu\u4e4bjdk\u5b89\u88c5\u300b\uff0c\u804a\u804a\uff0c\u6211\u4eec\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01 1.oracle\u5b98\u7f51\u4e0b\u8f7d\u538b\u7f29\u5305 \u70b9\u51fb\u94fe\u63a5 2.\u89e3\u538b tar -zxvf jdk-8u171-linux-x64.tar.gz 3.\u79fb\u52a8\u5230\u5236\u5b9a\u76ee\u5f55 ##\u5c06\u6587\u4ef6\u4ece\u4e0b\u8f7d\u76ee\u5f55 \u632a\u5230\/usr\/local\u4e0b sudo mv jdk1.8.0_171 \/usr\/local\/jdk1.8 4.\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf vim \/etc\/profile \u5728\u6587\u4ef6\u672b\u5c3e\u52a0\u5165 export JAVA_HOME=\/usr\/local\/jdk1.8 export JRE_HOME=${JAVA_HOME}\/jre export CLASSPATH=.:${JAVA_HOME}\/lib:${JRE_HOME}\/lib export PATH=.:${JAVA_HOME}\/bin:$PATH \u5982\u679c\u663e\u793a\u65e0\u6cd5\u4fdd\u5b58\u4fee\u6539\u547d\u4ee4 sudo vim \/etc\/profile 5.\u4f7f\u914d\u7f6e\u751f\u6548 source \/etc\/profile 6.\u68c0\u67e5\u662f\u5426\u751f\u6548 java -version \u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6587\u7ae0\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-52440","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52440"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52440\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}