[Updated, sorry about the change but now to the real problem] I cannot include try-catch-loop there for the exception from the method getCanonicalPath(). I trie
You are missing the type of your variable, it should be
public static void String startingPath ...