Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert my Java code to an EXE via java code not using any third party tools?

Tags:

java

exe

First i want to convey is, my Question is Not duplicate to this Question, How can I convert my Java program to an .exe file?.

Since My question, I had wrote a Swing program, in that program, there is a Button called "Generate EXE" , when the Button is clicked i have to generate the EXE of that program, so i need to create EXE via Java Code, i had created EXE using Advance Installer IDE http://www.advancedinstaller.com/user-guide/tutorial-java.html, But now my requirement is i have to generate EXE via Java code not using IDE by manually, my java code has create the EXE.

Thanks


1 Answers

This is not how to make an exe but since I think these solutions do the same job and I would personally prefer them, will post it anyway:

  • Create executable jar instead of exe
  • generate a script (in your case probably .bat file) which will run the java with appropriate parameters for you

If the exe is absolute requirement, convert the .bat file to exe (google for bat to exe)

like image 93
Jan Zyka Avatar answered Jan 23 '26 14:01

Jan Zyka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!