Requirements for emulation
Hoeven et al. studied the problem of digital preservation through emulation:

... Digital preservation does not end with the careful storage of digital objects. In order
to keep these objects accessible, a continuous effort towards the development of
strategies for permanent access is required ....

They ended up with a modular emulation model and the need of an Universal Virtual Machine (UVM):

... The basis of the modular emulation model is founded on the Universal Virtual
Machine (UVM). The UVM is a platform- and time-independent layer on top of the
underlying future host platform. As a result, programs that are developed for the
UVM will continue to work even if the host platform changes. It not only consists of a general purpose processor and memory, but also offers additional functionality for input and output (I/O) communication with peripheral devices (like keyboard, storage, graphics,
networking) between host and target platform. This will be provided by the interface
layer.

.. and started the "Dioscuri project": a modular emulator for digital preservation. Not surprisingly, they chose Java to implement it: 

... Java has been chosen as programming language. The main reason is its possibility to run Java code on a large variety of computer platforms using the Java Virtual Machine (JVM) without the need to recompile the source code. Recompilation is a risk factor since program code is adapted to a specific underlying computer platform. Although today’s compilers are very advanced, it can still result in different functionality of the same emulator compiled for different platforms. By avoiding this step, the emulator will be more stable and portable. Using the JVM instead provides similar results to the use of a UVM as discussed above....

The papers:


"Modular emulation as a long-term preservation strategy for digital objects" (2005)
"Emulation for Digital Preservation in Practice: The Results" (2007)


EDIT: the last changelog  of the Dioscuri project is dated: 19-Jan-2011
... so - perhaps - a new project/research should be started: "How to preserve the digital preservation tools?" :-D :-D

EDIT 2: just my personal opinion: if the Java program does useful things, humanity will preserve it without the need of any efforts by its author :-)