Java and Windows – error: illegal escape character You need to escape the backslashes used in your path. String windowsPath = "\\Users\\FunkyGuy\\My Documents\\Hello.txt";