Perhaps db4o would work for you. Don't let the name fool you, it can be embedded. According to its tutorial:
Object yourObject = ...;
String fileName = ...; // where you wish to store the objects
ObjectContainer container = Db4oEmbedded.openFile(Db4oEmbedded.newConfiguration(), fileName);
try {
container.store(yourObject);
} finally {
container.close();
}