How to upload ready HEX file using processing or java?

Checkout this: http://arduinocommander.blogspot.com/2013/03/upload-sketch.html