What if someone wants to run your Java program but doesn’t have the required Java Runtime Environment (JRE) installed on his computer? You could tell him where to download Java so he could install it, but chances are that he would instead just not use your program. This would greatly reduce sales of your program. Consider including the JRE with your program.

Licensing Issues

Always check for licensing issues before you include a third party program with your program. Read the “License to Distribute” section of the license agreement for the version of the JRE that you plan to use, and make sure that you understand and follow the terms of that agreement.

Advantages of including the JRE

By including the JRE with my program, the user can install both my program and the JRE by downloading a single file, and then run just one install wizard. The user does not have to figure out how and were to get the required JRE. Nor does he have to stop in the middle of installing my program in order to go find Java.

I use Inno Setup to create my install wizard. My install wizard checks if the user has the minimum required version of the JRE installed. If he does, it installs just my program. If he does not have the minimum required version of the JRE, my install wizard asks if he wants to install it, and if so, installs the JRE that is included with my program. After installing my program, my install wizard deletes the JRE install file, freeing up space from a large file that is no longer needed.

Inno Setup, available free of charge, is a very comprehensive program for creating Windows install wizards.  Download Inno Setup from http://www.jrsoftware.org/isinfo.php.

Disadvantages of including the JRE

My Java programs are small. Even with all my program’s required resources, my setup.exe file is often less than 2 MB. The JRE installer adds 15 MB to the size of my setup.exe file, greatly increasing the file size. Larger files take longer to download. The disadvantage of including the JRE in my install wizard is that some potential users of my program may decide to not bother downloading my program if its download takes too long.

Offer Both

I decided to offer both solutions. The user may choose to download the version of my installer with the JRE, or the one without the JRE. I believe I would lose more potential users of my program if I didn’t include the JRE than if I did, so the default download option is the one with the installer. But then I also provide the alternative option to download the much smaller installer without Java if the user believes he has a valid version of Java already on his computer.

Conclusion

One basic rule to keep in mind when you create your program’s install wizard is always minimize the nubmer of steps required of the user. You don’t want a potential customer to give up just because too many steps or decisions were required to install your program.

By bundling the JRE with your program and letting your installer decide if it will be needed, you greatly simplify the installation of your program and its requirements.

Related posts:

  1. The Minimum Java Runtime Environment (JRE) for Your Program
  2. Should You Create a Windows .EXE Wrapper for Java Programs?
  3. How To Distribute Java External Jar Files
  4. Create a File Type Association
  5. Create a Software License Agreement

About the Author


Comments are closed.

More Do-It-Yourself Java Games

More Do-It-Yourself Java Games: An Introduction to Java Graphics and Event-Driven Programming is the second book of the Do-It-Yourself Java Games series. You'll learn to create windows and dialogs, to add buttons and input fields, to use images and drawings, and to respond to keyboard input and mouse clicks and drags. You'll create 10 more games including several puzzles, a dice game, a word game, and a card game.

This book assumes you either have an understanding of basic Java programming or you have read the first book, Do-It-Yourself Java Games: An Introduction to Java Computer Programming. Read more.

Do-It-Yourself Java Games

Do-It-Yourself Java Games: An Introduction to Java Computer Programming uses a unique "discovery learning" approach to teach computer programming: learn Java programming techniques more by doing Java programming than by reading about them.

Through extensive use of fill-in blanks, with easy one-click access to answers, you will be guided to write complete programs yourself, starting with the first lesson. You'll create puzzle and game programs like Choose An Adventure, Secret Code, Hangman, Crazy Eights, and many more, and discover how, when, and why Java programs are written the way they are. Read more

Step-by-Step Tutorial

Many of the tips, techniques, and tools discussed in this blog are demonstrated in a detailed step-by-step tutorial in the book, This Little Program Went to Market, by Annette Godtland.

The book takes a computer program through the entire process of creating, deploying and distributing a program, then selling and marketing it (or any other product) on the Internet. Read more.