You should try the open source project called JavaHMO