{"id":45915,"date":"2025-11-04T12:17:48","date_gmt":"2025-11-04T04:17:48","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=45915"},"modified":"2025-11-04T12:17:48","modified_gmt":"2025-11-04T04:17:48","slug":"java%e8%83%bd%e5%bc%80%e5%8f%91exe%e5%90%97%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2025\/ruanjiankf\/45915\/","title":{"rendered":"java\u80fd\u5f00\u53d1exe\u5417\uff1f"},"content":{"rendered":"<p>Java\u672c\u8eab\u662f\u8de8\u5e73\u53f0\u7684\uff0c\u6240\u4ee5Jav\ufffd\u7a0b\ufffde\ufffd\ufffd\u662f\u76f4\u63a5\u7f16\u8bd1\u4e3a\u7279\u5b9a\u5e73\u53f0\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff08\u5982Windo\ufffd\ufffd\u6280\u5de7\u5c06Java\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684Windows\u53ef\u6267\u884cexe\u6587\u4ef6\u3002\u5728\u6b64\uff0c\u6211\u5c06\u7ed9\u4f60\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Java\u8fdb\u884cexe\u6587\u4ef6\u5f00\u53d1\u7684\u539f\u7406\u548c\u65b9\u6cd5\u3002<\/p>\n<p>\u539f\u7406:<\/p>\n<p>\u7531\u4e8eJava\u7a0b\u5e8f\u662f\u4ee5\u8de8\u5e73\u53f0\u7684\u5b57\u8282\u7801\u5f62\u5f0f\u7f16\u8bd1\u7684\uff0c\u56e0\u6b64\u5b83\u4e0d\u80fd\u76f4\u63a5\u8fd0\u884c\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u3002Java\u7a0b\u5e8f\u9700\u8981\u901a\u8fc7Java\u8fd0\u884c\u65f6\u73af\u5883\uff08Java Runtime Envi<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/24\/13\/16341591621.jpg\" \/><\/figure>\n<\/p>\n<p>ronment, JRE\uff09\u6765\u89e3\u91ca\u6267\u884c\u8fd9\u4e9b\u5b57\u8282\u7801\u3002\u800c\u5c06Java\u7a0b\u5e8f\u8f6c\u6362\u6210exe\u6587\u4ef6\u7684\u6838\ufffdJa\ufffd\ufffd\u8def\ufffd\ufffd\ufffd\uff0cJava\u865a\u62df\u673a\u4f1a\u52a0\u8f7d\u5b57\u8282\u7801\u6587\ufffd\ufffd\ufffd\u6253\u5305\u6210\u4e00\ufffd\ufffd\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-55.html\">fla\u751f\u6210exe<\/a><\/p>\n<p>\u65b9\u6cd5:<\/p>\n<p>J\u4e0b\u7a0b\u5e8f\u51e0\u79cd\u5c06Java\u7a0b\u5e8f\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u7684\u5e38\u89c1\u65b9\u6cd5\uff0c\u5b83\u4eec\u4f7f\u7528\u4e86\u4e0d\u540c\u7684\u7b2c\u4e09\u65b9\u5de5\u5177\u6765\u8fbe\u5230\u76ee\u7684\uff1a<\/p>\n<p>1. \u4f7f\u7528Launch4j<\/p>\n<p>Launch4j\u662f\u4e00\u4e2a\u7528\u4e8e\u5c06Java\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210Windows\u53ef\u6267\u884cexe\u6587\u4ef6\ufffdVM\uff0c\u8fd0\u884c\u65f6\u76f4\u63a5\u89e3\u91ca\u591f\u5c06\u4f60\u7684jar\u6587\u4ef6\u548cJRE\u73af\u5883\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u751f\u6210\u72ec\u7acb\u7684exe\u6587\u4ef6\ufffd\ufffd\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p>a. \u4e0b\u8f7d\u5e76\u5b89\u88c5Launch4j\uff1a\u8bbf\u95ee\u5b98\u65b9\u7f51\u7ad9(https:\/\/launch4j.sourceforge.io\/)\uff0c\u4e0b\u8f7d\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\uff0c\u7136\u540e\u89e3\u538b\u7f29\u5b89\u88c5\u3002<\/p>\n<p>b. \u6253\u5f00Launch4j\uff1a\u8fd0\u884cLaunch4j\uff0c\u4f60\u5c06\u770b\u5230\u4e00\u4e2a\u8bbe\u7f6e\u754c\u9762\uff0c\u7528\u4e8e\u4e3a\u4f60\u7684Java\u7a0b\u5e8f\u914d\u7f6e\u542f\u52a8\u53c2\u6570\u3002<\/p>\n<p>c. \u914d\u7f6eexe\u4fe1\u606f\uff1a\u5728\u201cOutput file\u201d\u6587\u672c\u6846\u4e2d\uff0c\u9009\u62e9\u4f60\u60f3\u751f\u6210\u7684exe\u6587\ufffd\ufffd\u7684\u8def\ufffd\ufffd\u53ca\ufffd\u72ec\u7acb\u7684\u53ef\u6267\u884c\ufffd\u201d\u6587\u672c\u6846\u4e2d\uff0c\u9009\u62e9\u4f60\u7684Java\u7a0b\u5e8f\u7684jar\u6587\u672c\u5730\u4ee3\ufffd \u914d\ufffd\ufffdJRE\u9009\u9879\uff1a\u8f6c\u5230\u201cJRE\u201d\u9875\u7b7e\uff0c\u5728\u201cMin JRE version\u201d\u6587\u672c\u6846\u4e2d\u8bbe\u7f6e\u6700\u4f4e\u517c\u5bb9\u7684JRE\u7248\u672c\uff0c\u4f8b\u5982\u201c1.8.0\u201d\u3002<\/p>\n<p>e. \u751f\u6210exe\u6587\u4ef6\uff1a\u70b9\u51fb\u201cBuild\u4f8b\u7684\u7b80\ufffd\u6309\ufffd\ufffd\ufffd\ufffd\u6b64\ufffd Lau\u8f7d\ufffdj\u5c06\u4e3a\u4f60\u751f\u6210\u4e00\u4e2aexe\u6587\u7f51http:\/\/launch4j.sourceforge.net\/\uff0c<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-6470.html\">\u53cc\u51fb\u751f\u6210\u7684exe<\/a>\u4e0b\u8f7d\ufffd\ufffd\u5408\ufffd\ufffd\u64cdjpackage\ufffd\ufffd\ufffd\ufffdJava 14\u5f00 \u51c6\u5907Java\u7a0b\u5e8f\u7684.jar\u6027\u529f\u80fd\uff0c\u5b83\u5141\u8bb8\u4f60\u5c06Java\u7a0b\u5e8f\u548cJava\u8fd0\u884c\u65f6\u73af\u5883\u4e00\u8d77\u6253\u5305\u6210\ufffdLaunch4j\uff0c\u914d\u7f6e\u76f8\u5173\u4fe1\u606f\uff1a<\/p>\n<p>   &#8211; \u9009\u62e9Input\u6587\u4ef6\uff1a\u9009\u62e9\u60a8\u7684.jar\u6587\u4ef6\u3002<\/p>\n<p>   &#8211; \u9009\u62e9Output\u6587\u4ef6\uff1a\u4e3a.exe\u6587\u4ef6\u6307\u5b9a\u8def\u5f84\u548c\u6587\u4ef6\u540d\u3002<\/p>\n<p>   &#8211; \u8bbe\u7f6eJRE\u7684\u6700\u4f4e\u548c\u6700\u9ad8\u7248\u672c\u3002<\/p>\n<p>   &#8211; \u82e5\u8981\u7ed1\u5b9aJVM\uff0c\u53ef\u5728&#8221;JRE&#8221;\u9009\u9879\u5361\u52fe\u9009\u201cBundled\/Downloaded\u201d\u3002<\/p>\n<p>4. \u5b8c\u6210\u914d\u7f6e\u540e\uff0c\u70b9\u51fb&#8221;Build Wrapper&#8221;\uff0c\u751f\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u867d\u7136Java\u672c\u8eab\u4e0d\u76f4\u63a5\u652f\u6301\u751f\u6210exe\u6587\u4ef6\uff0c\u4f46\u901a\u8fc7\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06Java\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\uff0c\u5b9e\u73b0\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u7684\u5feb\u901f\u90e8\u7f72\u548c\u4fbf\u6377\u8fd0\u884c\u3002\ufffd\ufffd\u7a0b\u5e8f\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542bexe\u6587\u4ef6\u548c\u8fd0\u884c\u65f6\u73af\u5883\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u8fd9\u4e9b\u65b9\u6cd5\u4ec5\u751f\u6210Windows\u5e73\u53f0\u4e0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5bf9\u4e8e\u5176\u4ed6\u5e73\u53f0\uff08\u5982 macOS \u548c Linux\uff09\uff0c\u9700\u8981\u4f7f\u7528\u5bf9\u5e94\u5e73\u53f0\u7684\u5de5\u5177\u548c\u65b9\u6cd5\u3002\u540c\u65f6\uff0c\u4e3a\u4e86\u4fdd\u6301\u8de8\u5e73\u53f0\u7279\u6027\uff0c\u8bf7\u786e\u4fdd\u5c06exe\u6587\u4ef6\u548cjar\u6587\u4ef6\u4e00\u540c\u5206\u53d1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u672c\u8eab\u662f\u8de8\u5e73\u53f0\u7684\uff0c\u6240\u4ee5Jav\ufffd\u7a0b\ufffde\ufffd\ufffd\u662f\u76f4\u63a5\u7f16\u8bd1\u4e3a\u7279\u5b9a\u5e73\u53f0\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff08\u5982Windo\ufffd\ufffd\u6280\u5de7\u5c06Java\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684Windows\u53ef\u6267\u884cexe\u6587\u4ef6\u3002\u5728\u6b64\uff0c\u6211\u5c06\u7ed9\u4f60\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528J<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[35248,1858,114,81,179],"topic":[],"class_list":["post-45915","post","type-post","status-publish","format-standard","hentry","category-ruanjiankf","tag-python-exe","tag-exe","tag-114","tag-81","tag-179"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/45915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=45915"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/45915\/revisions"}],"predecessor-version":[{"id":45918,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/45915\/revisions\/45918"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=45915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=45915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=45915"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=45915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}