Srinivasan Srinivasan - 7 months ago 53
Java Question

Illegal character in path at index 16

I am getting the following error in RAD: Illegal character in path at index 16: file:/E:/Program Files/IBM/SDP/runtimes/base......

Could you please let me know what is the error and how to resolve it?


There's an illegal character at index 16. I'd say it doesn't like the space in the path. You can percent encode special characters like spaces. Replace it with a %20 in this case.

The question I linked to above suggests using URLEncoder:

String thePath = "file://E:/Program Files/IBM/SDP/runtimes/base";
thePath = URLEncoder.encode(thePath, "UTF-8");