《java打包exe步骤.docx》由会员分享,可在线阅读,更多相关《java打包exe步骤.docx(8页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、JAVA打包EXE步骤1 .前提工作,安装文件exe4j和innosetup下载地址Inno Setup: 密码:dausexe4j: 密码:b9z9.桌面创立一个xxxx文件夹,工程install打包好jar一般在target目录下;拷贝本地java 环境的jre目录到桌面xxxx文件夹下;2 . 翻开 exe4j,点击 project type,选择 jar in exe mode exe4j1. Welcome2. Proj ect type3. Application info4. Executable info5. Java invocation6. JRE7. Splash scr
2、een3. Messages9. Compile executable10. Finished exe4j8. Welcome9. Proj ect type10. Application info11. Executable info12. Java invocation13. JRE14. Splash screen3. Messages11. Compile executable12. Finished- XChoose project typePlease choose the type of operation you want to perform ith exe4j:。Regul
3、ar modeIn regular mode, exe4j does not include Java classes into the executable. It uses the specified JAR files and directories that have to be distributed along with it. This mode is suitable for all Java auuli cations. JAR in EXE modeQ HelpQ HelpIn JAR in EXE mode, exe4j compiles JAR files into t
4、he executable. In this way you can distribute a Java application as a single EXE. You cannot include directories or files other than JAR files.Next Finish Cancel. ,点击 Application info exe4j1234WelcomeProject typeApplication infoExecutable info Java invocation JRESplash screenMessagesCompile executab
5、leConfigure application应用的名称General10. Finished桌面创立xxxx文件夹路径FinishCancel5. Executable info32- bit or 64-bit exe4j1. Welcome2. Project type3. Application info4. Executable infoAdv*nc-ed opr ions:, Redirection, Service options, Version info, 32bit or 64-bit, Manifest options5. Java invocation6. JRE7.
6、Splash screen8. Messages9. Compile executable10. Finished- XSelect the architecture of the generated executableIf the application should run with a 64-bit JVM, you can choose to generate a 64-bit executable.Please note that the 1auncher will not run with 32-bit JVMs in that case. This means that it
7、will not run on a 32-bit Windows at all.0 Generate 64-bit executable。HelpFinishCancel6. Java invecationLiQexe4jh1.Welcomeg,2.ProjecttypeL3.Applicationinfo4. Executable info5. Java invocationAdvanced options: , llative libraries6. JRE7. Splash screen8. Messages9. Compile executable10. FinishedConfigu
8、re Java invocationVM Parameters: -Dfile. encodinutf-S11 Allow VM passthrough parameters (e. g. -J-Xmx256m)Configure Version-Specific VM Parameters Cl ass path O1 Module pathArchive C : UsersAdainistratorDesktoppriiitCJ-Print_0. 0. 1-SIAPSHOT. j ar可运行的jar文件路径Main class from Class path v com. cj. prin
9、t. CJPrintApplicationArguments for main class: Advanced OptionsO Help Finish Cancel7. P exe4j1. WelcomeProject type2. Application infoExecutable info3. Java invocationJREAdvanced options:, Search sequence, Preferred TMSplash screen4. MessagesCompile executable5. FinishedConfigure JREPlease define th
10、eMinimum version:Maximum version: Search sequence exe4j1. Welcome2. Project type_ 3. Application info4. Executable info5. Java invocation6. JREAdvanced options:il Search sequence2 Preferred TM“ 7. Splash screen8. Messages9. Compile executable11 10. FinisheditminimjnrveryiinrTfquijrements for the JRE
11、 that your application Till be started with.根据自己的需要填写,我这里是I I Allow JREs withI I Only all07 JDKsa beta version numberand no JREs Advanced OptionsO Help Finish Cancel- XConfigure search sequenceOn the target system, the generated executable searches for a JRE or JDK in the following configurable orde
12、r.芸 Search windows registry目 Environment variable JAVA_H0ME3 Environment variable JDK_HOMEDirectory .jrel. 8. 0_91这里./jre./加上左面文件夹里画e的文件名称O Help点击添加 Finish Cancel 点击finish生成在桌面文件夹xxxx里面生成exe文件8. 安装 Inno Setup Compiler,并翻开;0 Untitled - Inno Setup Compiler 5.6.1 la)Ale Edit View Build Run Tools HelpM
13、口蒯旭。匈 点击匈建Inno Setup Script WizardWelcome to the Inno Setup Script WizardThe wizard 词 guide you through the process of aeobng a new Irmo Setup script fie. The results wi be used to generate a new sapt fte vxhdi can be compted drectly or saved on disk fbr later use.Not m features of Inno Setup are co
14、vered by ths Mizard. See the doajfnentabon fix details on aeatng Imo SetLp saipt fies.Ckk Next to contnue, or Cancel to exit ths wizard.点击下一步Insert9. 点击next0 Untitled - Inno Setup Compiler S.6.1 (a)Ale Edit View Build Run Tools Help口蒯初。曲 M QCanedInsert10.点击 next0 Untitled - Inno Setup Compiler S.6.1
15、 (a)Ale Edit View Build Run Tools HelpInsert11.点击 next0 Untitled - Inno Setup Compiler S.6.1 (a)Ale Edit View Build Run Tools HelpInsertInno Setup Script WizardApplication Folder PNase specify folder informabon About your dppftctjonApplicdtkm destination base folderProgram Fte fbbcrMy Programhd Alow
16、 user to change the applcAttcn folderOther: The appkation doesnt need a fbiderbold = requiredInno Setup Script Wizard应用名称Next- CanedApplication RiesPNase specify the fies that are part of your app匕bon.殂投Application main executable file:|c:yro9ram Fties (x86)Vnno 83 5amg更面 print OneDriveQ WPS网盘选择卓面文件
17、夹里面生成f 5exePP对象Addfoktef.Other oppttcabon fles:bold = required CanedB颊匚图片,TftJ)音乐工 Win 10 Pro x&!_杆胆(6)轩加卷(E:)名称q-print-log jrT,0 9(print.exe文件名(N): print.exe0 Untitled - Inno Setup Compiler S.6.1 (a)Ale Edit View Build Run Tools Help12.点击 next0 Untitled - Inno Setup Compiler S.6.1 (a)Ale Edit View
18、Build Run Tools Help一口的的。正匈0 QInno Setup Script WizardApplication ShortcutsPNase specify Miich shortcuts should be aeated for your app4sb8.0 Create a shortcut to the man executable m the common Start Menu Programs fbWer Stort Menu fdefer none:My ProgramR Alow user to change the Start Menu folder nam
19、e Alow user to dsable Start Menu foider creation Create an Internet shortcut n the Start Menu fokterI Crete an Uhinstdl shortcut in the Start Menu folderOther shortcuts to the main executable:0 Alow user to create a desktop shortcut Alow user to create a Qukk Launch shortcut on dder versons of Wndowsbold = requiredBadc Next)| QtnceiInsert13 .点击next到此页面0 Untitled - Inno Setup Compiler S.6.1 (a)Ale Edit View Build Run Tools Help口蒯初。 M QInno Setup Script WizardCompiler SettingsPNase specify some basic corrpier settings.生成的文件放在哪个目录在成文件的名称生成文件的图标 CmalInsert. 一直点到finish完成此应用打包
限制150内