Adjusted code to account for "user.dir" 'bug'.

System.getProperty("user.dir") only return the jar directory on Windows.