Actually, in the code "a.java" is used.Assuming that a file named "MyTest.java" exists in c:\pathtest\ as well as in c:\pathtest\dir2, what will happen when the following code is compiled and run?
So on my machine, it will throw a java.nio.NoSuchFileException.
Changing "MyTest.java" to "a.java" should fix the issue.