SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    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.

    Thanks,

  2. #2
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!
    Brad Culbert
    SQL Server 2005 Books
    www.SQLServer2005Books.com - Reader-rated SQL Server 2005 Books

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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/.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    WOW! Great help guys! 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?

  5. #5
    SitePoint Zealot Wilmot's Avatar
    Join Date
    Feb 2000
    Location
    Brisbane, Queensland, Australia
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Brad Culbert
    SQL Server 2005 Books
    www.SQLServer2005Books.com - Reader-rated SQL Server 2005 Books


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •