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?
Asked
Active
Viewed 509 times
0
-
1What kind of program is it? Is it a server application? Is it a desktop application? Docker images are a ni e way to distribute server applications – Erwin Bolwidt Mar 24 '19 at 01:22
-
It is a desktop application – Javissimo Mar 24 '19 at 01:23
-
^ So Swing/AWT or JavaFX – Mr. Polywhirl Mar 24 '19 at 01:23
-
What are So Swing/AWT and JavaFX? – Javissimo Mar 24 '19 at 01:26
-
Swing/AWS and JavaFX are Java packages for building graphical user interfaces. – CryptoFool Mar 24 '19 at 01:34
1 Answers
1
Java .jar files are runnable on any Java Virtual Machine. It is a design choice that allows your .jar to be portable.

Bruce S.
- 54
- 3
-
But every time I downloaded a java program I never used a .jar file, but I have ever used an .exe file in a folder – Javissimo Mar 24 '19 at 01:28
-
Not only are .jar files runnable on any JVM, they can contain almost any possible supporting files, including dependency modules the code depends on, config files, data files, etc...pretty much anything. – CryptoFool Mar 24 '19 at 01:29
-
Since .jar files are a little foreign to regular uses, I think they are often wrapped in a native application just to make people feel better and give them something that acts like other native apps. For example, a .jar file isn't going to have a nice icon. I've never had to deal with this. I assume there are packages that can create the right wrappers for all the common platforms, but that's just a guess. – CryptoFool Mar 24 '19 at 01:30
-
See: https://stackoverflow.com/questions/5869665/how-to-create-native-binaries-for-your-java-app – CryptoFool Mar 24 '19 at 01:36