I have messed around with JAVA for some time now and have never figured out how to make my little programs standalone applications that I can distribute. How do I go about making a JAVA application distributable, so that someone can double click on its icon (still got to figure out how to make those too) and the program starts.
Also, does anyone know of a window creator for JAVA? I am kind of tired of writing all of the windowing code that my apps require.
You can pack all the .java files used in a program into a single .jar file. I believe this can be made to execute automatically when clicked. It probably just executes the 'main' method. While I havn't used this myself, I have seen it done quite a few times. Assuming you are using a Windows environment, type jar /? in a DOS prompt for instructions on using it.
There are a few visual design tools around, I think JBuilder is one, not sure of any others. However, be careful when using these, I have alwayse been told that it is better to write the GUI's yourself, as the visual tools put in a LOT of useless code which bloat your programs.
Hope this helps!
Yep -- JAR files are the way to go. By specifying the name of the class containing the main function in the JAR files manifest (a plain text file in the archive containing information about the packaged application), the JAR file becomes executable. You can then run the program from the command line by typing:
java -jar jarfile.jar
Also, any Windows system with the JDK or JRE installed can launch such JAR files by double-clicking on them.
Another option is a program called InstallAnywhere. This lets you package your application as a Windows .exe (or an executable file for Unix/Linux) that installs the program just like a native Windows application, with a Start menu icon and everything. "InstallAnywhere Now" is a free version of this utility, while the commercial version, "InstallAnywhere Pro", will also automatically install the JRE if neccessary, and provides more options for branding, etc. Check it out at http://www.installanywhere.com/.
WOW! Great help guys! :D Thanks!!!
Is there any other installer like InstallAnywhere? Or couldn't I just put the JRE in with the install?
Also, is there any sites (besides Sun's) that offer message boards, tutorials, articles, etc, specifically for JAVA?
Glad we could help.
You may want to try http://www.freejavahelp.com as well as http://www.bruceeckel.com/TIJ2/index.html. The later of these two is a free downloadable E-Book called "Thinking in Java Second Edition"
I will update this post when I find some more.