{"id":810,"date":"2020-04-27T23:43:48","date_gmt":"2020-04-27T15:43:48","guid":{"rendered":"http:\/\/prayerlaputa.com\/?p=810"},"modified":"2020-04-27T23:43:48","modified_gmt":"2020-04-27T15:43:48","slug":"spring%e9%a1%b9%e7%9b%ae%e9%83%a8%e7%bd%b2linux%e6%97%b6%e8%af%bb%e5%8f%96%e5%ad%97%e4%bd%93%e5%a4%b1%e8%b4%a5%e5%af%bc%e8%87%b4%e7%bb%98%e5%9b%be%e6%97%b6%e8%be%93%e5%87%ba%e4%b9%b1%e7%a0%81","status":"publish","type":"post","link":"http:\/\/prayerlaputa.com\/?p=810","title":{"rendered":"spring\u9879\u76ee\u90e8\u7f72linux\u65f6\u8bfb\u53d6\u5b57\u4f53\u5931\u8d25\u5bfc\u81f4\u7ed8\u56fe\u65f6\u8f93\u51fa\u4e71\u7801"},"content":{"rendered":"<h1 id=\"%E7%8E%B0%E8%B1%A1\" class=\"mume-header\">\u73b0\u8c61<\/h1>\n<p>spring\u9879\u76ee\u90e8\u7f72linux\u65f6\u8bfb\u53d6\u5b57\u4f53\u5931\u8d25\u5bfc\u81f4\u7ed8\u56fe\u65f6\u8f93\u51fa\u4e71\u7801\uff0c\u6bd4\u5982\u8bf4\u8c03\u7528<code>Graphics2D graphic<\/code>\u7ed8\u56fe\u65f6\u7528\u5230\u5b57\u4f53\uff0c\u5374\u8f93\u51fa\u4e71\u7801\u3002<\/p>\n<h1 id=\"%E5%8E%9F%E5%9B%A0\" class=\"mume-header\">\u539f\u56e0<\/h1>\n<p>\u5b57\u4f53\u6587\u4ef6\u627e\u4e0d\u5230\uff0c\u6bd4\u5982\u8bf4\u5f00\u53d1\u73af\u5883\u662fwindows\uff0c\u53ef\u80fd\u662f\u4f7f\u7528\u201c\u5fae\u8f6f\u96c5\u9ed1\u201d\u5b57\u4f53\uff0c\u662f\u6b63\u5e38\u7684\uff0c\u4f46\u90e8\u7f72\u5230\u7ebf\u4e0a\uff08\u5f80\u5f80\u662flinux\uff09\uff0c\u5c31\u4f1a\u662f\u4e71\u7801\u3002<!--more--><\/p>\n<h1 id=\"%E8%A7%A3%E5%86%B3\" class=\"mume-header\">\u89e3\u51b3<\/h1>\n<h3 id=\"1-%E6%89%BE%E5%88%B0%E9%A1%B9%E7%9B%AE%E6%89%80%E9%9C%80%E5%AD%97%E4%BD%93%E4%B8%8A%E4%BC%A0%E5%88%B0linux%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E5%B9%B6%E6%94%BE%E5%88%B0%E6%8C%87%E5%AE%9A%E4%BD%8D%E7%BD%AE\" class=\"mume-header\">1\u3001\u627e\u5230\u9879\u76ee\u6240\u9700\u5b57\u4f53\uff0c\u4e0a\u4f20\u5230linux\u670d\u52a1\u5668\u4e2d\uff0c\u5e76\u653e\u5230\u6307\u5b9a\u4f4d\u7f6e<\/h3>\n<p>\u5148\u8bf4\u7ed3\u8bba\uff1a<strong>\u6211\u4e2a\u4eba\u4e0d\u63a8\u8350\u8fd9\u6837\u505a\uff01\uff01\uff01<\/strong><\/p>\n<p>\u6bd4\u5982\u8bf4\u8fd9\u7bc7\u5e16\u5b50\u4e2d\u8bf4\u7684\uff08\u6211\u6ca1\u8bd5\u9a8c\uff0c\u7f51\u4e0a\u641c\u5230\u987a\u624b\u8f6c\u7ed9\u5927\u5bb6\uff09\uff1a<br \/>\n<a href=\"https:\/\/blog.csdn.net\/weixin_33772645\/article\/details\/859430219\">java jdk-awt.font\u5728centos\u4e0a\u4e2d\u6587\u4e71\u7801\u7684\u95ee\u9898, \u5b89\u88c5\u4e2d\u6587\u5b57\u4f53<\/a><\/p>\n<p>\u4e4b\u6240\u4ee5\u4e0d\u63a8\u8350\uff0c\u662f\u56e0\u4e3a\u8fd9\u6837\u505a\uff0c\u7ebf\u4e0a\u90e8\u7f72\u65f6\u589e\u52a0\u4e86\u4f9d\u8d56\u5173\u7cfb\uff0c\u589e\u52a0\u4e86\u7ef4\u62a4\u6210\u672c\u3002<\/p>\n<h3 id=\"2-%E5%B0%86%E6%89%80%E4%BE%9D%E8%B5%96%E5%AD%97%E4%BD%93%E6%94%BE%E5%85%A5%E5%88%B0%E9%A1%B9%E7%9B%AE%E4%B8%AD%E7%9B%B4%E6%8E%A5%E4%B8%80%E8%B5%B7%E9%83%A8%E7%BD%B2%E5%88%B0%E7%BA%BF%E4%B8%8A%E7%8E%AF%E5%A2%83\" class=\"mume-header\">2\u3001\u5c06\u6240\u4f9d\u8d56\u5b57\u4f53\u653e\u5165\u5230\u9879\u76ee\u4e2d\uff0c\u76f4\u63a5\u4e00\u8d77\u90e8\u7f72\u5230\u7ebf\u4e0a\u73af\u5883<\/h3>\n<p>\u6211\u4e2a\u4eba\u89c9\u5f97\u8fd9\u6837\u505a\u6bd4\u8f83\u597d\uff0c\u56e0\u4e3a\u4e0d\u4f1a\u4f9d\u8d56\u5916\u90e8\u73af\u5883\uff0c\u6240\u9700\u505a\u7684\u53ea\u662f\u8bfb\u53d6\u81ea\u5e26\u7684\u5b57\u4f53\u6587\u4ef6\u800c\u5df2\u3002<br \/>\n\u5f53\u7136\uff0c\u8fd9\u91cc\u57cb\u7740\u51e0\u4e2a\u5751\uff0c\u5206\u4eab\u4e0b\uff1a<\/p>\n<h4 id=\"1%E6%95%B4%E4%B8%AA%E9%A1%B9%E7%9B%AE%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6-%E4%BE%9D%E8%B5%96%E5%8C%85%E7%AD%89%E6%89%93%E6%88%901%E4%B8%AAjar%E5%8C%85%E9%83%A8%E7%BD%B2%E6%97%B6%E6%B3%A8%E6%84%8F%E8%AF%BB%E5%8F%96%E6%96%87%E4%BB%B6%E7%9A%84%E6%96%B9%E5%BC%8F\" class=\"mume-header\">\uff081\uff09\u6574\u4e2a\u9879\u76ee\uff08\u8d44\u6e90\u6587\u4ef6\u3001\u4f9d\u8d56\u5305\u7b49\uff09\u6253\u62101\u4e2ajar\u5305\u90e8\u7f72\u65f6\uff0c\u6ce8\u610f\u8bfb\u53d6\u6587\u4ef6\u7684\u65b9\u5f0f<\/h4>\n<p>\u7531\u4e8e\u6587\u4ef6\u90fd\u5df2\u7ecf\u4fdd\u5b58\u5230\u4e86\u4e00\u4e2ajar\u5305\u4e2d\uff0c\u76f4\u63a5\u8c03\u7528<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>File file = ResourceUtils.getFile(\"classpath:excelTemplate\/test.xlsx\");\r\nInputStream inputStream = new FileInputStream(file);\r\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u53ef\u80fd\u8bfb\u53d6\u4e0d\u5230\u6587\u4ef6\uff0c\u9700\u8981\u4f7f\u7528Classloader\u53bb\u8bfb\u53d6\uff0c\u5177\u4f53\u53c2\u8003\u4e0a\u7bc7\u6587\u7ae0<a href=\"http:\/\/prayerlaputa.com\/?p=806#more-806\">spring-boot\u4ee5jar\u5305\u65b9\u5f0f\u65f6\u8bfb\u53d6resource\u6216\u662ftemplate\u6587\u4ef6<\/a><\/p>\n<h4 id=\"2%E8%AF%BB%E5%8F%96%E5%AD%97%E4%BD%93%E6%96%87%E4%BB%B6-%E5%88%9B%E5%BB%BAfont%E5%AF%B9%E8%B1%A1%E6%97%B6%E5%8F%AF%E8%83%BD%E5%AD%98%E5%9C%A8%E4%B8%8D%E6%96%AD%E5%88%9B%E5%BB%BA%E4%B8%B4%E6%97%B6%E6%96%87%E4%BB%B6%E7%9A%84%E9%97%AE%E9%A2%98\" class=\"mume-header\">\uff082\uff09\u8bfb\u53d6\u5b57\u4f53\u6587\u4ef6\u3001\u521b\u5efaFont\u5bf9\u8c61\u65f6\uff0c\u53ef\u80fd\u5b58\u5728\u4e0d\u65ad\u521b\u5efa\u4e34\u65f6\u6587\u4ef6\u7684\u95ee\u9898<\/h4>\n<p>\u8fd9\u4e2a\u95ee\u9898\u6211\u5728\u7f51\u4e0a\u641c\u65f6\u9891\u7e41\u51fa\u73b0\uff0c\u6211\u81ea\u5df1\u6ca1\u9047\u5230\uff0c\u8d34\u51fa\u6765\u4f9b\u5927\u5bb6\u53c2\u8003\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/shuchongqu\/article\/details\/84791122\">java\u5f15\u5165\u81ea\u5b9a\u4e49\u5b57\u4f53\u7684\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/nahancy\/article\/details\/75482418\">Java\u5f15\u7528\u5916\u90e8\u5b57\u4f53\u5373\u81ea\u5b9a\u4e49\u5b57\u4f53\u6587\u4ef6<\/a><\/li>\n<\/ul>\n<p>\u4e0d\u4f1a\u521b\u5efa\u4e34\u65f6\u6587\u4ef6\u7684\u4ee3\u7801\uff1a<\/p>\n<pre class=\"language-\" data-role=\"codeBlock\" data-info=\"\"><code>\t\/\/filepath\u5b57\u4f53\u6587\u4ef6\u7684\u8def\u5f84\r\n\tprivate static java.awt.Font getSelfDefinedFont(String filepath){\r\n        java.awt.Font font = null;\r\n        File file = new File(filepath);\r\n        try{\r\n            font = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, file);\r\n            font = font.deriveFont(java.awt.Font.PLAIN, 40);\r\n        }catch (FontFormatException e){\r\n            return null;\r\n        }catch (FileNotFoundException e){\r\n            return null;\r\n        }catch (IOException e){\r\n            return null;\r\n        }\r\n        return font;\r\n    }\r\n\r\n<\/code><\/pre>\n<h1 id=\"%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" class=\"mume-header\">\u53c2\u8003\u8d44\u6599<\/h1>\n<ul>\n<li><a href=\"https:\/\/blog.csdn.net\/shuchongqu\/article\/details\/84791122\">java\u5f15\u5165\u81ea\u5b9a\u4e49\u5b57\u4f53\u7684\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/nahancy\/article\/details\/75482418\">Java\u5f15\u7528\u5916\u90e8\u5b57\u4f53\u5373\u81ea\u5b9a\u4e49\u5b57\u4f53\u6587\u4ef6<\/a><\/li>\n<li><a href=\"https:\/\/blog.csdn.net\/weixin_33772645\/article\/details\/859430219\">java jdk-awt.font\u5728centos\u4e0a\u4e2d\u6587\u4e71\u7801\u7684\u95ee\u9898, \u5b89\u88c5\u4e2d\u6587\u5b57\u4f53<\/a><\/li>\n<li><a href=\"http:\/\/prayerlaputa.com\/?p=806#more-806\">spring-boot\u4ee5jar\u5305\u65b9\u5f0f\u65f6\u8bfb\u53d6resource\u6216\u662ftemplate\u6587\u4ef6<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u8c61 spring\u9879\u76ee\u90e8\u7f72linux\u65f6\u8bfb\u53d6\u5b57\u4f53\u5931\u8d25\u5bfc\u81f4\u7ed8\u56fe\u65f6\u8f93\u51fa\u4e71\u7801\uff0c\u6bd4\u5982\u8bf4\u8c03\u7528Graphics2D grap <a href='http:\/\/prayerlaputa.com\/?p=810' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[6,75],"tags":[33,76],"_links":{"self":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/810"}],"collection":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=810"}],"version-history":[{"count":2,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":812,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions\/812"}],"wp:attachment":[{"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/prayerlaputa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}