diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index c851a0d75a..ff728b5365 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -323,7 +323,19 @@ extern "C" JNIEXPORT jstring JNICALL Java_java_io_File_toAbsolutePath(JNIEnv* e UNUSED, jclass, jstring path) { #ifdef PLATFORM_WINDOWS - // todo + string_t chars = getChars(e, path); + if (chars) { + const unsigned BufferSize = MAX_PATH; + char_t buffer[BufferSize]; + DWORD success = GetFullPathNameW(chars, BufferSize, buffer, 0); + releaseChars(e, path, chars); + + if (success) { + return e->NewString + (reinterpret_cast(buffer), wcslen(buffer)); + } + } + return path; #else jstring result = path;