In this paper we describe a way to save and restore the state of a running Java program. We achieve this on the language level, without modifying the Java virtual machine, by instrumenting the programmer's original code with a preprocessor. The automatically inserted code saves the runtime information when the program requests state saving and reestablishes the program's runtime state on restart. The current preprocessor prototype is used in a mobile agent scenario to o er transparent agent migration for Java based mobile agents, but could generally be used to save and reestablish the execution state of any Java program.