Hi,
Welcome to JavaRanch!
For us to explain the error, we'd have to see your code; I can show you the right way to do it, though:
String s = "C:\\windows\\system32\\drivers\\etc\\hosts";
s = s.replaceAll("\\\\", "/");
There are
four backslashes there, because the backslash is a special character to both the
Java compiler and the regular expression compiler. You have to double the backslash to tell the Java compiler to treat it as a plain character, and double it again to tell the regular expression compiler the same thing.