How to use javapackager to create executable file for my code?

527 views Asked by At

I saw this stack overflow post to know how to create executable files from java source , where it says to use javapackager he also says that it is included with Java JDK but I dont have any clue of how to use it. I read this oracle documentation but still didn't get much how to create native type .exe file for my code like I tried it on cmd and it says javapackager is not a valid command , I found these ways old so How can I make a .exe file for my java code now .

1

There are 1 answers

0
JCWasmx86 On BEST ANSWER

javapackager was removed from the JDK. The recommended way is now (It is better,if you have a modular application) to use jlink and/or jpackage

#Create modular runtime image with your modules foo.mod and bar.utils
#into outputdir
jlink --add-modules foo.mod,bar.utils --output outputdir
#Create native "installer", e.g. .deb on Debian
jpackage -n name --runtime-image outputdir/