toRealPath throws InternalError: Should not get here on Windows (paths with junctions)
Alan Bateman
Alan.Bateman at oracle.com
Tue Mar 15 11:28:54 UTC 2016
On 15/03/2016 11:19, Dawid Weiss wrote:
> I couldn't find an appropriate bug in bugzilla, but this fails
> reliably for me with Java 8 and 9 on Windows 10, 64-bit:
>
> mkdir foo
> mklink /J bar foo
> cd bar
> java -cp Test .
>
> where Test.java is as simple as:
>
> import java.io.*;
> import java.nio.file.*;
>
> public class Test {
> public static void main(String[] args) throws Exception {
> System.out.println("p.toRealPath(): " + Paths.get(args[0]).toRealPath());
> }
> }
>
> The thrown error shows:
>
> Exception in thread "main" java.lang.InternalError: Should not get here
> at sun.nio.fs.WindowsNativeDispatcher.GetFinalPathNameByHandle(Native
> Method)
There are a number of win32 functions that this code uses GetProcAddress
to get their address in kernel32. This dates back to when we had to
support Windows XP. This should be cleaned up now. Doesn't explain why
you are seeing though, can you submit a bug?
-Alan
More information about the core-libs-dev
mailing list