Added chdir with helpful error message for JVM