Absolutely you can use it on another JVM; that's what is so darn cool about RMI, for example!! Assuming you do not have versioning problems with the object/class itself (in other words, as long as the correct version of the class is where the object needs to be deserialized, then it should work just fine. There are issues that surround how you actually GET that class to the *other* side, but that's a different (and more advanced) discussion.
Moving serialized objects from one machine to another is the key foundation to Java's distributed remote method invocation (RMI). In RMI, an object in a heap on JVM A is calling a method on an object in another heap on JVM B (which could mean a different physical machine with a different operating system, but that doesn't matter!), and the arguments and return values are passed (if references to objects) as serialized copies of the actual objects. So if I have a PetOwner on one machine passing a reference to a Dog to a method of a Vet object running on a different machine, then that Dog object will be serialized and shipped over. Which means the Vet object now has a COPY of the actual Dog object.
This foundation is the basis for other Java distributed technologies including Jini and Enterprise Javabeans (
EJB), so if it didn't work that way, then communications between clients and servers would be very restricted.
Good question!
cheers,
Kathy