10/23/2022 0 Comments Install4j launcher class path![]() ![]()
Modify the application description (according to the official website, specified but invalid, can be ignored).You can also enter Javapackager directly to view the help, or go to the official website to view it Let's do some customization The target More parameters will be attached at the end of the article. INSTALL4J LAUNCHER CLASS PATH CODEname CS- Specifies the application name after startup Copy the code appClass cn.qs.CS- Fully qualified name of the main class of the jar file. outfile cs- output file (do not suffix, such as cs.exe, just write cs). Native image- Create disk image for jar (can replace image with other type, such as exe, msi, deb, RPM) -outdir cs- output directory. Simply put, it is packaged as an EXE or other platform package that generates a basic application without any parameters. Javapackager is used to build the distribution of the target machine. Now let's see what the above command means. TXT fileĪt this point, the simple packaging is over. Find cs.exe and run it as administrator.Įnter C disk can find the program generated I am the test file. You will find a folder called CS in the sibling directory, go into CS, and go into the Bundles folder. Input: javapackager -deploy -native image -outdir cs -outfile cs -srcfiles pack.jar -appclass cn.qs.CS -name CS Go to the folder where you downloaded the jar package and open PowerShell (If the file is not generated after startup, end the process in Task Manager and run the program as an administrator.)īy default, you have read and finished preparing the content. Sample JAR program (this article uses this JAR as an example for easy communication learning)Īfter starting the program, a file named I am test file.txt will be created on disk C, and the words "sleep * seconds" will be written to the file every second, until 10 seconds after the program ends, there will be written success at the end. ![]() Wix (packaged as MSI must be downloaded, if javapackager is not downloaded, wiX is missing) ![]() Inno Setup Compiler (Java8 supports version 6 below, do not download version 6 or later, otherwise the package will not be successful) INSTALL4J LAUNCHER CLASS PATH HOW TONow let's take a look at how to package jar packages into native form packages. Java14's JPackage allows you to specify whether to display the console. It is recommended to use a log file instead. Unfortunately, the contents of the console cannot be displayed. That leaves java14's Jpackage and Java8's Javapackager, both of which I've tried with almost constant results and roughly the same package size (without any tweaking of the JRE).įinally, the tool javapackager, which comes with Java8, was selected. Someone mentioned jaOT for Java9 in the blog I checked, downloaded Java9, but didn't find jaOT, considering the common version is 8, so JAOT is also excluded. There's also jaot for Java9, jpackage for earlier versions of java14, and javapackager for java8 In addition to exe4j, there are also install4j, jwrapper and other tools, but they are charged, so they are excluded. Of course, I've been looking at a lot of blogs and their websites,Įxe4j was the one I saw the most, but I saw some comments saying it didn't work when packaged, and it didn't work when I downloaded exe4j. Java can be packaged into native platform types, for example: INSTALL4J LAUNCHER CLASS PATH INSTALLIn normal times we will package it as Jar, so when running on other platforms need to install JRE to support running. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |