Virtual machines (VM) are promising as system software in sensor networks. A major impediment to their widespread acceptance is their performance overhead. Compiling VM bytecode to native code addresses this, but increases footprint and code distribution costs. Thus, there is an important tradeoff between cost of computing, and cost of communication due to code distribution. In this paper, we describe a remote Just-In-Time (JIT) compilation service for the VM framework that is effective in combining interpretation with native execution to arrive at an efficient hybrid execution configuration. The principles apply to any middleware used to develop applications in sensor networks.