java.net.MalformedURLException: no protocol:

java.net.MalformedURLException: no protocol:
使用geotools中的gt2-shapefile-2.4-RC0.jar这个包对shp格式的文件进行属性读取。不知道为什么会遇到这么一个错误:
Exception in thread "main" java.net.MalformedURLException: no protocol: shp/res1_4m.dbf
 at java.net.URL.<init>(Unknown Source)
 at java.net.URL.<init>(Unknown Source)
 at java.net.URL.<init>(Unknown Source)
 at com.geotools.readshp.ReadSHP.main(ReadSHP.java:35)

早上用2.3的时候没有这个错误,只是因为2.3在读取中文的时候存在编码问题,需要修改geotools的源码,结果发现2.4已经可以支持使用shpDataStore.setStringCharset(Charset.forName("UTF-8"));的方法了,所以就更新了一把。。谁知道居然成了这样的效果。继续排查ing

你可能感兴趣的:(java.net.MalformedURLException: no protocol:)