Create an .exe file from Java project [duplicate] - java

This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
Closed 2 years ago.
So i just finished a small Java program that I've been working on throughout the week and I want to generate an .exe file of it so I can share with my friends. I'm working on Apache Netbeans 11.3 and JDK 8.
I can successfully generate the .jar file but that's pretty much useless.

If you created a java project, then the "other" computer should have the java runtime installed, in order for the jar to be executed there (java -jar your.jar) otherwise if you really want an .exe use one of the many jar2exe converters found on the almighty internet, such as ja2exe you can download it

Related

How to distribute a java program? [duplicate]

This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
How do I create an .exe for a Java program? [duplicate]
(7 answers)
Closed 3 years ago.
I wrote my own java program, but I don't know how to distribute it. After making 'Clean and Build' (from Netbeans) a .jar file is created for me. Do I have to distribute that or do some procedure to create an .exe file?
Java .jar files are runnable on any Java Virtual Machine. It is a design choice that allows your .jar to be portable.

Intellij JavaFX vs Java Project for .exe file [duplicate]

This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
Closed 3 years ago.
I have already a Java Project in Intellij.
I want to make a .exe Java file, but I did not find any solution yet for Java Projects. On the other hand, I have found many youtube videos in which they use a JavaFX Project to create an artifact which they will use to create a .exe file.
One of them is the following youtube video:
IntelliJ export JavaFX application to exe on Windows
My end goal is, that a user just double clicks on the file and a GUI opens. After entering some information the rest of the code should run. The file should be able to run to different windows systems, so this should not only work when installing special packages.
Did I chose the wrong type of project? To that I just read, that JavaFX will be discontinued.
I am confused in so many levels...
You should first make an executable .jar file and then use an .exe wrapper on the jar. I've used
Launch4j in the past with great success. I haven't tried it on javafx yet, but there are many executable wrappers to choose from with a quick google search. If this is at all unclear, leave a comment, and I'll detail these steps more. Launch4j has an almost self explanatory interface, so I don't think you should have trouble as long as you're sure your .jar launches.
What you're looking for is an executable jar file I think. I know that eclipse you can generate one so I'd assume you can do the same in intellij. How to

How to run exe file whereas currently running jar [duplicate]

This question already has answers here:
Creating non-reverse-engineerable Java programs
(14 answers)
Closed 4 years ago.
I have a spring based workflow system where the java plugins are uploaded and kept in jar format, they are referred and used by the jar file. However, I have seen that jar file is very easy to decompile and it is a security risk.
I tried obfuscation as well. I want to run exe so that it is run at byte code so it is very very hard to reverse engineer.
You could use ProGuard as optimizer and obfuscator.
ProGuard also has a maven plugin that you can use it in the build process.

Unable to create .exe from java file [duplicate]

This question already has answers here:
How can I convert my Java program to an .exe file?
(16 answers)
Closed 8 years ago.
I have created java project that contains 6 Class file and 1 java file
And I run this project in net beans IDE now my problem is when I clean and build this project am unable to create exe file
How can I make this project as exe (an executable file)?
all 7 files in one single as executable
and found this and tried from here making executable file from a java project using NetBeans Can some one help me to solve my problem
The JAR file format provides many benefits.
You can make your Java application runnable via a double-click by packaging it into an executable jar.
This answer will help you.

Wrapping JRE with my JAR in one EXE file [duplicate]

This question already has answers here:
Bundling the JRE with a Java application
(2 answers)
Closed 8 years ago.
I have read many threads in stackoverflow but I didn't get the answer.
I used JSmooth and Launch4j but what I want exactly is to get a final .exe file from my JAR application and a JRE so that my windows client won't need to install any JRE (in another way: to get a portable application with its own JVM)
I found that is not possible but why? Does that need the compilation fo the jre with my application source?
I hope my question is clear, any help will be appreciated.
Zip the JRE folder and include it as a resource in your .exe file.
At run time, you'll need to extract that resource to the disk, unzip it and then invoke it using ShellExecute to run your .jar file. The size of your executable will probably be quite huge.
This is your only viable solution.. Otherwise, if it is for windows only, why not just write the whole application in C++? Is there a reason why you need your JRE with the application? Why not let the user install their own JVM?

Categories