MetaVM is a distributed object system for Java virtual machine. It allows programmers to deal with remote objects in the same way they do local objects. Therefore, it can provide a single machine image to programmers. We implemented a runtime compiler of Java bytecode to provide the facilities. The runtime compiler generates a native code which can handle remote objects beyond the network besides the local objects. The compiler uses semantic expansion, which is a technique that changes the original semantics of a Java bytecode.