First test to see if the outcome is what you expect by running your Java app from the same terminal window.