Unfortunately these examples turn out to be out of date (wrong) or they only work for NetBeans or only in a Web container. The examples I have found on the blog links in the message above don't actually work - the format of persistence.xml is invalid (the property tag requires a value attribute) and the location of persistence.xml is wrong (it has to be in the directory META-INF even if you are not using a jar). I'm going to post a simple JSE example so that people don't have to get stuck on bad examples.
[Message sent by forum member 'jotobjects' (jotobjects)]
http://forums.java.net/jive/thread.jspa?messageID=204749