{"id":3607,"date":"2018-07-19T23:59:16","date_gmt":"2018-07-19T15:59:16","guid":{"rendered":"http:\/\/switch.linesno.com\/?p=3607"},"modified":"2018-07-19T23:59:16","modified_gmt":"2018-07-19T15:59:16","slug":"ubuntu16-04-%e4%bd%bf%e7%94%a8ppa%e5%ae%89%e8%a3%85jdk8","status":"publish","type":"post","link":"http:\/\/switch.linesno.com\/?p=3607","title":{"rendered":"Ubuntu16.04 \u4f7f\u7528PPA\u5b89\u88c5JDK8"},"content":{"rendered":"<p><strong>\u5b89\u88c5Java 8 ( \u652f\u6301 Ubuntu 10.04 &#8211; Ubuntu 16.04 )<br \/>\n<\/strong><\/p>\n<p>1\u3001\u5982\u679c\u4f60\u5728 Ubuntu \u8f6f\u4ef6\u4e2d\u5fc3\u5b89\u88c5\u8fc7 OpenJDK\uff0c\u8bf7\u5148\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5c06\u5176\u5220\u9664\uff1a<\/p>\n<p>sudo apt-get purge openjdk*<\/p>\n<p>2\u3001\u6dfb\u52a0 PPA \u6e90<\/p>\n<p>sudo add-apt-repository ppa:webupd8team\/java<\/p>\n<p>3\u3001\u66f4\u65b0\u4e0b\u6e90\u6570\u636e\u5e93<\/p>\n<p>sudo apt-get update<\/p>\n<p>4\u3001\u5b89\u88c5 Oracle Java 8<\/p>\n<p>sudo apt-get install oracle-java8-installer<\/p>\n<p>5\u3001\u67e5\u770b\u7248\u672c\uff1a<\/p>\n<p>java -version<\/p>\n<p>6\u3001\u8bbe\u7f6e Java 8 \u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<p>sudo apt-get install oracle-java8-set-default<\/p>\n<p>7\u3001java\u7248\u672c\u5207\u6362<\/p>\n<p>sudo update-java-alternatives -s java-8-oracle<\/p>\n<p>8\u3001\u5378\u8f7djdk<\/p>\n<p>sudo apt-get remove\u00a0<span class=\"pln\"><span class=\"pun\"><span class=\"kwd\">oracle-java8-installer<\/span><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5Java 8 ( \u652f\u6301 Ubuntu 10.04 &#8211; Ubuntu 16.04 ) 1\u3001\u5982\u679c\u4f60 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3607","post","type-post","status-publish","format-standard","hentry","category-day"],"_links":{"self":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3607"}],"version-history":[{"count":1,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3607\/revisions"}],"predecessor-version":[{"id":3608,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=\/wp\/v2\/posts\/3607\/revisions\/3608"}],"wp:attachment":[{"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3607"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/switch.linesno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}