Java and Windows - error: illegal escape character

前端 未结 6 1209
失恋的感觉
失恋的感觉 2021-01-14 06:04

I have done my .java file that changes registry data. But I am getting \"illegal escape character\" error on the line where Runtime.getRuntime().exec exists. Wh

6条回答
  •  渐次进展
    2021-01-14 06:19

    You need to escape the backslashes used in your path.

    String windowsPath = "\\Users\\FunkyGuy\\My Documents\\Hello.txt";
    

提交回复
热议问题