\u547d\u4ee4<\/a>\u3002\u53e6\u5916\uff0c\u8fd8\u9700\u8981\u628a\u4e0b\u8f7d\u7684JDK1.7 RPM\u5305\u653e\u5230\u5408\u9002\u7684\u5730\u65b9\uff0c\u4e00\u822c\u5efa\u8bae\u653e\u5728\u4e00\u4e2a\u4e13\u95e8\u5b58\u653e\u5b89\u88c5\u6587\u4ef6\u7684\u76ee\u5f55\u91cc\uff0c\u6bd4\u5982\/opt\u6216\u8005\/usr\/local\u3002\u8fd9\u6837\u505a\u4e0d\u4ec5\u4fbf\u4e8e\u7ba1\u7406\uff0c\u800c\u4e14\u4e5f\u7b26\u5408Linux\u7cfb\u7edf\u7684\u6587\u4ef6\u7ba1\u7406\u89c4\u8303\u3002\u5982\u679c\u968f\u610f\u653e\u7f6e\u6587\u4ef6\uff0c\u5c06\u6765\u5728\u5378\u8f7d\u6216\u5347\u7ea7JDK\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u9ebb\u70e6\u3002<\/p>\n<\/p>\n
\u5b89\u88c5\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u67e5\u770bRPM\u5305\u4e2d\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u7ed3\u6784\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u8fd0\u884crpm -qlp\u547d\u4ee4\u5b9e\u73b0\uff0c\u7136\u540e\u8f93\u5165\u6211\u4eec\u4e0b\u8f7d\u7684JDK1.7 RPM\u5305\u7684\u540d\u79f0\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u6211\u4eec\u5c31\u80fd\u9884\u5148\u4e86\u89e3\u8fd9\u4e2a\u5305\u5bf9\u7cfb\u7edf\u53ef\u80fd\u4ea7\u751f\u7684\u5f71\u54cd\uff0c\u4ece\u800c\u907f\u514d\u5728\u4e0d\u77e5\u60c5\u7684\u60c5\u51b5\u4e0b\u968f\u610f\u5b89\u88c5\u3002<\/p>\n
JDK1.7 RPM\u5305\u7684\u5b89\u88c5<\/b><\/p>\n
\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u8bf7\u5728\u7ec8\u7aef\u8f93\u5165rpm -ivh\u547d\u4ee4\uff0c\u540c\u65f6\u63d0\u4f9bJDK1.7 RPM\u5305\u7684\u5b8c\u6574\u540d\u79f0\u3002\u7cfb\u7edf\u5c06\u663e\u793a\u5b89\u88c5\u8fdb\u5ea6\u548c\u76f8\u5173\u4fe1\u606f\u3002\u82e5\u9047\u5230\u4f9d\u8d56\u9879\u95ee\u9898\uff0c\u5b89\u88c5\u8fc7\u7a0b\u53ef\u80fd\u53d7\u963b\u3002\u6bd4\u5982\uff0c\u53ef\u80fd\u4f1a\u63d0\u793a\u7f3a\u5c11\u5e93\u6587\u4ef6\uff0c\u8fd9\u65f6\u60a8\u9700\u8981\u5148\u5b89\u88c5\u5fc5\u8981\u7684\u4f9d\u8d56\u5e93\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528yum\u6216apt-get\uff08\u6839\u636e\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u53ef\u80fd\u4f7f\u7528\u4e0d\u540c\u7684\u5305\u7ba1\u7406\u5668\uff09\u6765\u67e5\u627e\u5e76\u5b89\u88c5\u7f3a\u5931\u7684\u5e93\u3002\u5982\u679c\u5b58\u5728\u591a\u4e2a\u4e0eJDK\u76f8\u5173\u7684RPM\u5305\uff0c\u8bf7\u6ce8\u610f\u5b89\u88c5\u987a\u5e8f\uff0c\u9519\u8bef\u7684\u5b89\u88c5\u987a\u5e8f\u53ef\u80fd\u4f1a\u5bfc\u81f4\u95ee\u9898\u3002<\/p>\n
<\/p>\n
\u5b89\u88c5\u65f6\u82e5\u9047\u5230\u6743\u9650\u63d0\u793a\uff0c\u5f97\u786e\u8ba4\u5f53\u524d\u7528\u6237\u662f\u5426\u6709\u8db3\u591f\u7684\u6743\u9650\u6765\u8fdb\u884c\u5b89\u88c5\u3002\u82e5\u6743\u9650\u4e0d\u591flinux\u64cd\u4f5c\u7cfb\u7edf\u600e\u4e48\u6837\uff0c\u5b89\u88c5\u4f1a\u5728\u9519\u8bef\u63d0\u793a\u5904\u505c\u4e0b\u6765\u3002\u5982\u679c\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u7a81\u7136\u4e2d\u65ad\uff0c\u4e0d\u8981\u6025\u7740\u91cd\u65b0\u5b89\u88c5\uff0c\u5148\u67e5\u770b\u65e5\u5fd7\uff0c\u627e\u51fa\u4e2d\u65ad\u7684\u539f\u56e0\uff0c\u89e3\u51b3\u4e86\u95ee\u9898\u518d\u7ee7\u7eed\u5b89\u88c5\u3002<\/p>\n
\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/b><\/p>\n
\u88c5\u597dJDK1.7\u540e\uff0c\u5f97\u8c03\u6574\u73af\u5883\u53d8\u91cf\u3002JAVA_HOME\u548cPATH\u662f\u4e24\u4e2a\u5173\u952e\u7684\u73af\u5883\u53d8\u91cf\u3002\u8c03\u6574\u5b83\u4eec\uff0c\u5f97\u6539.bashrc\u6216.bash_profile\u6587\u4ef6\uff0c\u4e0d\u540cLinux Shell\u7684\u914d\u7f6e\u6587\u4ef6\u53ef\u80fd\u4e0d\u4e00\u6837\u3002JAVA_HOME\u53d8\u91cf\u8981\u6307\u5411JDK1.7\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u8fd9\u6837\u7cfb\u7edf\u624d\u80fd\u51c6\u786e\u627e\u5230JDK\u3002\u53e6\u5916\uff0cPATH\u53d8\u91cf\u91cc\u5f97\u52a0\u5165JDK\u7684bin\u76ee\u5f55\uff0c\u8fd9\u6837\u4e0d\u7ba1\u5728\u54ea\u4e2a\u76ee\u5f55\uff0c\u90fd\u80fd\u7528java\u3001javac\u7b49Java\u547d\u4ee4\u3002<\/p>\n
\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u6210\u529f\u540e\uff0c\u5fc5\u987b\u786e\u8ba4\u5176\u751f\u6548\u3002\u901a\u8fc7\u6267\u884csource\u547d\u4ee4\u5e76\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\uff0c\u8fd9\u4e00\u6b65\u9aa4\u53ef\u4ee5\u987a\u5229\u5b8c\u6210\u3002\u82e5\u73af\u5883\u53d8\u91cf\u672a\u88ab\u6fc0\u6d3b\uff0c\u65b0\u5f00\u542f\u7684\u7ec8\u7aef\u5728\u8fd0\u884cJava\u547d\u4ee4\u65f6\uff0c\u53ef\u80fd\u4f1a\u663e\u793aJava\u672a\u5b89\u88c5\u6216\u547d\u4ee4\u672a\u627e\u5230\u7684\u63d0\u793a\u3002\u540c\u65f6\uff0c\u52a1\u5fc5\u68c0\u67e5\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u7684\u6b63\u786e\u6027\uff0c\u5373\u4fbf\u662f\u7ec6\u5fae\u7684\u62fc\u5199\u9519\u8bef\uff0c\u4e5f\u53ef\u80fd\u9020\u6210\u914d\u7f6e\u5931\u6548\u3002<\/p>\n
\u9a8c\u8bc1\u5b89\u88c5\u6210\u529f<\/b><\/p>\n
<\/p>\n
\u5b89\u88c5\u5b8c\u6bd5\u540e\uff0c\u8981\u6838\u5b9eJDK1.7\u662f\u5426\u5b89\u88c5\u6b63\u786e\u3002\u5728\u7ec8\u7aef\u8f93\u5165java -version\u6307\u4ee4\uff0c\u82e5\u663e\u793aJDK1.7\u7684\u7248\u672c\u53f7\uff0c\u5373\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002\u63a5\u7740\uff0c\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Java\u7a0b\u5e8f\uff0c\u6bd4\u5982HelloWorld\uff0c\u4ee5\u6d4b\u8bd5Java\u5f00\u53d1\u73af\u5883\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\u3002\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199HelloWorld\u7a0b\u5e8f\uff0c\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u7528javac\u547d\u4ee4\u8fdb\u884c\u7f16\u8bd1\uff0c\u518d\u7528java\u547d\u4ee4\u8fd0\u884c\u3002\u5982\u679c\u7a0b\u5e8f\u80fd\u6210\u529f\u7f16\u8bd1\u548c\u6267\u884c\uff0c\u90a3\u4e48JDK1.7\u5728Linux\u7cfb\u7edf\u4e2d\u7684\u5b89\u88c5\u5c31\u662f\u6b63\u786e\u7684\u3002\u82e5\u51fa\u73b0\u9519\u8bef\uff0c\u9700\u6839\u636e\u9519\u8bef\u4fe1\u606f\u56de\u6eaf\u68c0\u67e5\u5b89\u88c5\u548c\u914d\u7f6e\u6b65\u9aa4\u3002<\/p>\n
\u5728\u5b89\u88c5Linux\u7cfb\u7edf\u4e0a\u7684JDK1.7 RPM\u5305\u65f6\uff0c\u4f60\u9047\u5230\u4e86\u56f0\u96be\u5417\uff1f\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u8be6\u7ec6\u5206\u4eab\u4f60\u7684\u95ee\u9898\u3002\u6b64\u5916\uff0c\u82e5\u4f60\u89c9\u5f97\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9\uff0c\u8bf7\u4e0d\u541d\u70b9\u8d5e\u548c\u5206\u4eab\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u68c0\u67e5\u7cfb\u7edf\u73af\u5883\u5b89\u88c5\u524d\uff0c\u5fc5\u987b\u68c0\u67e5\u7cfb\u7edf\u8981\u6c42\u3002Linux\u6709\u591a\u4e2a\u7248\u672c\uff0c\u4e0d\u540c\u7248\u672c\u5728\u8f6f\u4ef6\u5305\u7ba1\u7406\u548c\u7cfb\u7edf\u8bbe\u7f6e\u4e0a\u7565\u6709\u4e0d\u540c\uff0c\u6bd4\u5982CentOS\u548cUbuntu\u5c31\u5b58\u5728\u5dee\u5f02\u3002\u5b89\u88c5\u4e4b\u524d\uff0c\u5efa\u8bae\u5148\u67e5\u770bRPM\u5305\u4e2d\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u7ed3\u6784\u3002\u82e5\u51fa\u73b0\u9519\u8bef\uff0c\u9700\u6839\u636e\u9519\u8bef\u4fe1\u606f\u56de\u6eaf\u68c0\u67e5\u5b89\u88c5\u548c\u914d\u7f6e\u6b65\u9aa4\u3002<\/p>\n","protected":false},"author":1,"featured_media":295378,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[5400,4529,5399,5401,5402],"class_list":["post-295377","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-JDK17","tag-lhj-2","tag-rbb","tag-azsx","tag-qxts-2"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/295377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=295377"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/295377\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/295378"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=295377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=295377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=295377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}