Installing Java Applications via "Setup" Utilities

As with many applications, you may wish to install a Java program with a setup utility that installs the files and sets up appropriate shortcuts. However, there are some subtleties with Java application installation that require some extra thought.

Java applications can only be run on a machine with a JRE (Java Runtime Environment), so any setup utility won’t run quite the same as other application setup files; you won’t be able to give someone your setup file and expect it to run correctly, unless they already have the appropriate JRE.

It is still possible to install Java applications using standard Windows Installer utilities; some tools allow you to bundle (or download and install) a suitable JRE as part of the Windows Installer process, resulting in the application’s files being installed along with any dependencies.

It’s even possible to install Java applications as a service in Windows, using additional wrapper utilities.

However, in Java, the usual way to do the “setup routine” is typically going to result in a “jar” file. This way, you can launch the program by using a shortcut that launches the JVM and points it to the appropriate jar file. From the user’s point of view, this is indistinguishable from any other shortcut, but of course it requires that the files and JRE have already been installed.


Who's Afraid of the Big Bad Bignum?

Short one this time.

If you’ve a bignum in Perl, it might be a bit intimidating. For example, how on Earth would you get the third last digit from an enormous number? Convert it to a string first? would that even work? Mod 1000?

Fortunately, bignums are transparently available; once you’ve got one in a variable, you treat it just like any other Perl scalar, so this will work:

$digit = substr($bignum, -3, 1);

Neat, eh?