What does exactly mean this sentence from this oracle java tutorial:
A relative path cannot be constructed if only one of the paths includes a root
I did some tests of your example. Actually the exception you are mentioning appears only when one of the paths contains root and the other not (exactly like the sentence says) E.g:
It works ok if both paths contain roots. The "system dependent" means probably such case on Windows:
Above gives following exception:
java.lang.IllegalArgumentException: 'other' has different root
You will never face something like this (exception for both paths containing root - absolute paths) on Unix