fix for Issue #179

tested on 2 macs one with jdk, one with jre.
needs testing on ubuntu.