{"id":40218,"date":"2025-11-04T12:17:49","date_gmt":"2025-11-04T04:17:49","guid":{"rendered":"https:\/\/app.60day.cn\/appday\/?p=40218"},"modified":"2025-11-04T12:17:49","modified_gmt":"2025-11-04T04:17:49","slug":"java%e7%bc%96%e8%af%91%e7%94%9f%e6%88%90exe%e6%9c%89%e5%93%aa%e4%ba%9b%e5%8a%9e%e6%b3%95%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/app.60day.cn\/appday\/kaifaexe\/40218\/","title":{"rendered":"java\u7f16\u8bd1\u751f\u6210exe\u6709\u54ea\u4e9b\u529e\u6cd5\uff1f"},"content":{"rendered":"<p>Java\u7f16\u8bd1\u751f\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd<\/p>\n<p>\u5728Java\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u4e00\u4e2a\u95ee<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/17\/15\/35303486022.jpg\" \/><\/figure>\n<\/p>\n<p>\u9898\uff0c\u5982\u4f55\u5c06Java\u7f16\u5199\u7684\u5e94\u7528\u7a0b\u5e8f\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u7684exe\u6587\u4ef6\uff0c\u4ee5\u65b9\u4fbf\u7528\u6237\u70b9\u51fb\u8fd0\u884c\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdJava\u7f16\u8bd1\u751f<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-1421.html\">msi\u6587\u4ef6\u751f\u6210exe<\/a>\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u3001\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u5e2e\u52a9\u521d\u5b66\u8005\u5b66\u4f1a\u5982\u4f55\u8fdb\u884c\u76f8\u5173\u64cd\u4f5c\u3002<\/p>\n<p>\u4e00\u3001\u539f\u7406<\/p>\n<p>Java\u662f\u4e00\u95e8\u8de8\u5e73\u53f0\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u5176\u57fa\u4e8eJava\u865a\u62df\u673a\uff08JVM\uff09\u8fd0\u884c\u3002\u6211\u4eec\u5148\u6765\u4e86\u89e3\u4e00\u4e0bJava\u7a0b\u5e8f\u8fd0\u884c\u7684\u57fa\u672c\u8fc7\u7a0b\u3002\u7f16\u5199\u597d\u4e00\u4e2aJava\u7a0b\u5e8f\u6e90\u6587\u4ef6\u540e\uff0c\u5bf9\u5176\u8fdb\u884c\u7f16\u8bd1\uff0c\u751f\u6210\u76f8\u5e94\u7684.class\u5b57\u8282\u7801\u6587\u4ef6\u3002\u5f53\u6211\u4eec\u8fd0\u884cJava\u7a0b\u5e8f\u65f6\uff0c\u5b9e\u9645\u4e0a\u662f\u5728\u8fd0\u884cJava\u865a\u62df\u673a\uff0c\u5b83\u4f1a\u8d1f\u8d23\u89e3\u91ca\u6267\u884c\u8fd9\u4e9b\u5b57\u8282\u7801\u6765\u5b9e\u73b0\u7a0b\u5e8f\u529f\u80fd\u3002Java\u7a0b\u5e8f\u5b9e\u9645\u4e0a\u6ca1\u6709\u7f16\u8bd1\u6210\u5e73\u53f0\u76f8\u5173\u7684\u4e8c\u8fdb\u5236\u4ee3\u7801\uff0c\u800c\u662f\u8de8\u5e73\u53f0\u7684\u5b57\u8282\u7801\u3002<\/p>\n<p>\u751f\u6210.exe\u6587\u4ef6\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u7528\u6237\u80fd\u591f\u5728Windows\u5e73\u53f0\u4e0a\u53cc\u51fb\u8fd0\u884c\u7a0b\u5e8f\u3002\u5173\u4e8eJava\u751f\u6210exe\u6587\u4ef6\uff0c\u6211\u4eec\u8981\u660e\u767d\u8fd9\u4e48\u4e00\u4e2a\u9053\u7406\uff1a\u5373\u4f7f\u751f\u6210\u4e86exe\u6587\u4ef6\uff0c\u5b9e\u9645\u4e0a\u8fd8\u662f\u8c03\u7528\u4e86Java\u865a\u62df\u673a\uff08JVM\uff09\u6765\u6267\u884c\u76f8\u5e94\u7684\u5b57\u8282\u7801\u3002<\/p>\n<p>\u4e8c\u3001\u65b9\u6cd5<\/p>\n<p>\u4e0b\u9762\u5c06\u4ecb\u7ecd\u4e24\u79cd\u5c06Java\u7a0b\u5e8f\u751f\u6210exe\u6587\u4ef6\u7684\u65b9\u6cd5\uff1a<\/p>\n<p>1. \u4f7f\u7528\u53ef\u6267\u884cJAR\uff08\u4e0d\u662f\u4e25\u683c\u610f\u4e49\u4e0a\u7684exe\u6587\u4ef6\uff09<\/p>\n<p>\u4e00\u4e2a\u53ef\u6267\u884c\u7684JAR\uff08Java Archive\uff09\u6587\u4ef6\u662f\u5305\u542b\u7a0b\u5e8f\u7684\u6240\u6709\u5b57\u8282\u7801\u548c\u8d44\u6e90\u6587\u4ef6\uff0c\u5e76\u6307\u5b9a\u4e86\u4e3b\u7c7b\uff08\u4e3b\u7a0b\u5e8f\u5165\u53e3\uff09\u7684\u4e00\u4e2a\u5f52\u6863\u6587\u4ef6\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Java\u547d\u4ee4\u6216\u53cc\u51fb\u8fd0\u884c\u3002\u5236\u4f5c\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p>1.1 \u7f16\u8bd1Java\u6e90\u4ee3\u7801\uff0c\u751f\u6210.class\u5b57\u8282\u7801\u6587\u4ef6\u3002<\/p>\n<p>1.2 \u521b\u5efamanifest\u6587\u4ef6\uff0c\u5305\u542b\u4e3b\u7c7b\u5c5e\u6027\uff08\u4e3b\u7a0b\u5e8f\u5165\u53e3\uff09\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aman<a href=\"https:\/\/www.yimenexe.com\/exe-kaifa-2825.html\">\u628aweb\u9879\u76ee\u5c01\u88c5\u6210exe<\/a>ifest.txt\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>Main-Class: com.example.Main<\/p>\n<p>&#8220;`<\/p>\n<p>\u8bf7\u786e\u4fdd\u5728\u6587\u4ef6\u7ed3\u5c3e\u5904\u7559\u4e00\u4e2a\u7a7a\u767d\u884c\u3002<\/p>\n<p>1.3 \u4f7f\u7528jar\u5de5\u5177\u6253\u5305\u6210\u53ef\u6267\u884cJAR\u6587\u4ef6\u3002\u4f8b\u5982\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>jar cfm example.jar manifest.txt com\/example\/*.class<\/p>\n<p>&#8220;`<\/p>\n<p>1.4 \u901a\u8fc7Java\u547d\u4ee4\u542f\u52a8\u7a0b\u5e8f\uff0c\u6216\u8005\u53cc\u51fbexample.jar\u8fd0\u884c\u3002<\/p>\n<p>2. \u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\u5c06Java\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6<\/p>\n<p>\u6709\u591a\u4e2a\u7b2c\u4e09\u65b9\u5de5\u5177\u53ef\u4ee5\u5c06Java\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\uff0c\u5176\u4e2d\u8f83\u4e3a\u6d41\u884c\u7684\u6709Launch4j\u3001Exe4j\u548cJSmooth\u3002<\/p>\n<p>\u4ee5\u4f7f\u7528Launch4j\u4e3a\u4f8b\uff1a<\/p>\n<p>2.1 \u4e0b\u8f7d\u5e76\u5b89\u88c5Launch4j\u3002<\/p>\n<p>2.2 \u6253\u5f00Launch4j\uff0c\u9009\u62e9&#8221;Output file&#8221;\uff08\u8f93\u51fa\u6587\u4ef6\uff09\u548c&#8221;Jar&#8221;\uff08\u53ef\u6267\u884cjar\u8def\u5f84\uff09\u3002<\/p>\n<p>2.3 \u5982\u679c\u9700\u8981\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#8221;Change dir&#8221;\u8bbe\u7f6e\u4e3a&#8221;Same dir as Jar&#8221;\uff0c\u8868\u793a\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u751f\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>2.4 \u8bbe\u7f6e&#8221;Minimum Java version&#8221;\uff08\u6700\u4f4eJava\u7248\u672c\uff09\u3002\u5fc5\u8981\u65f6\uff0c\u53ef\u4ee5\u5728&#8221;JVM options&#8221;\u4e2d\u8bbe\u7f6eJava\u865a\u62df\u673a\u53c2\u6570\u3002<\/p>\n<p>2.5 \u5728&#8221;Build Wrapper&#8221;\u9009\u9879\u5361\u4e2d\uff0c\u70b9\u51fb&#8221;Build wrapper&#8221;\u751f\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>\u4e09\u3001\u6ce8\u610f\u4e8b\u9879<\/p>\n<p>1. \u751f\u6210exe\u6587\u4ef6\u5e76\u4e0d\u662f\u8131\u79bb\u4e86Java\u8fd0\u884c\u73af\u5883\uff0c\u4ecd\u9700\u8981\u7528\u6237\u5b89\u88c5Java\u8fd0\u884c\u65f6\u73af\u5883\uff08JRE\uff09\u3002<\/p>\n<p>2. \u751f\u6210exe\u6587\u4ef6\u65f6\uff0c\u6ce8\u610f\u662f\u5426\u9700\u6dfb\u52a0\u7a0b\u5e8f\u6240\u9700\u7684\u7b2c\u4e09\u65b9\u5e93\u3001\u8d44\u6e90\u6587\u4ef6\u7b49\u3002<\/p>\n<p>3. \u8003\u8651\u5230\u8282\u7701\u7528\u6237\u4e0b\u8f7d\u548c\u5b89\u88c5\u65f6\u95f4\uff0c\u4e5f\u53ef\u4ee5\u5c06\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u5305\u542b\u4e86JRE\u7684exe\u6587\u4ef6\uff0c\u7531\u4e8e\u6d89\u53ca\u6cd5\u5f8b\u95ee\u9898\uff0c\u786e\u4fdd\u9075\u5faa\u76f8\u5173\u6761\u6b3e\u3002<\/p>\n<p>\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u60a8\u5df2\u7ecf\u4e86\u89e3\u4e86Java\u7a0b\u5e8f\u751f\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u548c\u65b9\u6cd5\uff0c\u5e76\u80fd\u591f\u6839\u636e\u9700\u8981\u5c06\u60a8\u7684Java\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java\u7f16\u8bd1\u751f\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u4e0e\u8be6\u7ec6\u4ecb\u7ecd\u5728Java\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u9047\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u5982\u4f55\u5c06Java\u7f16\u5199\u7684\u5e94\u7528\u7a0b\u5e8f\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u7684exe\u6587\u4ef6\uff0c\u4ee5\u65b9\u4fbf\u7528\u6237\u70b9\u51fb\u8fd0\u884c\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdJava\u7f16\u8bd1\u751f\u6210exe\u6587\u4ef6<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[35458,3683,132,35457,797],"topic":[],"class_list":["post-40218","post","type-post","status-publish","format-standard","hentry","category-kaifaexe","tag-jsexe","tag-3683","tag-132","tag-exe","tag-797"],"_links":{"self":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/40218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/comments?post=40218"}],"version-history":[{"count":1,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/40218\/revisions"}],"predecessor-version":[{"id":40231,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/posts\/40218\/revisions\/40231"}],"wp:attachment":[{"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/media?parent=40218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/categories?post=40218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/tags?post=40218"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/app.60day.cn\/appday\/wp-json\/wp\/v2\/topic?post=40218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}