索引16处路径中的非法字符 [英] Illegal character in path at index 16

查看:315
本文介绍了索引16处路径中的非法字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在RAD中收到以下错误:

I am getting the following error in RAD:

java.net.URISyntaxException: 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?

推荐答案

索引16处有一个非法字符。我会说它不喜欢路径中的空间。您可以百分比编码特殊字符,如空格。在这种情况下用%20替换它。

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.

我上面链接的问题建议使用 URLEncoder

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"); 

这篇关于索引16处路径中的非法字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆