diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 4d50227a83..131f7345ff 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -59,6 +59,7 @@ typedef int socklen_t; #else // not PLATFORM_WINDOWS # include +# include # include # include # include @@ -2586,7 +2587,10 @@ jvmInitProperties(Thread* t, uintptr_t* arguments) # endif local::setProperty(t, method, *properties, "java.io.tmpdir", "/tmp"); local::setProperty(t, method, *properties, "user.home", getenv("HOME")); - local::setProperty(t, method, *properties, "user.dir", getenv("PWD")); + + char buffer[PATH_MAX]; + local::setProperty(t, method, *properties, "user.dir", + getcwd(buffer, PATH_MAX)); #endif local::setProperty(t, method, *properties, "java.protocol.handler.pkgs",