Why does the method `relativize` behave differently on [java-8](/questions/tagged/java-8 "show questions tagged 'java-8'") and [java-11](/questions/tagged/java-11 "show questions tagged 'java-11'")?

```
Path path1 = Paths.get("/a/./b/../image.png");
Path path2 = Paths.get("/a/file.txt");
Path path = path1.relativize(path2);
System.out.println(path);

```

* [java-8](/questions/tagged/java-8 "show questions tagged 'java-8'") (1.8.0\_66 to be exact) prints `../../../../file.txt`. [JavaDoc](https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html#relativize-java.nio.file.Path-).
* [java-11](/questions/tagged/java-11 "show questions tagged 'java-11'") (11.0.4 to be exact) prints `../file.txt`. [JavaDoc](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/Path.html#relativize(java.nio.file.Path)).

The JavaDoc description of both versions is equal. I feel the [java-11](/questions/tagged/java-11 "show questions tagged 'java-11'") way looks like a correct behavior to me:

* `path1`: `/a/./b/../image.png` normalizes to `/a/b/../image.png` which normalizes to `/a/image.png`
* `path2`: `/a/file.txt`
* the way to *navigate* from `/a/image.png` and `/a/file.txt` is `../file.txt`

**Questions**

1. How is the [java-8](/questions/tagged/java-8 "show questions tagged 'java-8'") way supposed to be calculated? Doesn't it normalize the path? I don't understand how to get the result *from head*.
2. Why is there a difference between these two versions that is not documented at all?