i have a really basic java program just one .java/.class file (.java uncompiled .class compiled i guess) how do i make something that i can have run on someone elses computer?
6 Answers
This sort of kills the very purpose of Java (portability of the language), so you should always try to use the files compiled as .jar, since most of the computers out there (especially Windows and Macs) do have a Java Virtual Machine.
If you really need to compile something down to exe, you should be interested in Ahead-of-Time compilers (AOT), one of them being the GNU Compiler for Java.
Comments
You can use a tool like IzPack2exe. Even if you package the the program just as a jar file - double clicking it in windows win run it, if the user has Java installed.
2 Comments
For Java you usually build a jar file. You can simply execute it by double-clicking on it. It's basically a Zip file with some metadata and another name (yes, zip files don't have enough names already). Check out the jar tool that comes with your JDK. A Java IDE should also have the option to create such a thing.