FileNotFoundException when using Hadoop distributed cache

走远了吗. 提交于 2019-12-02 13:14:30

The problem is with the filename you are using "~/ayush/output/part-00000" relies on Unix shell (sh, bash, ksh) tilde expansion to replace the "~" with the pathname of your home directory.

Java (and C, and C++, and most other programming languages) don't do tilde expansion. You need to provide the pathname as "/home/ayush/output/part-00000" ... or whatever absolute pathname it is that the tilded form expands to.

Strictly speaking, the URI should be created as follows:

new File("/home/ayush/output/part-00000").toURI()

not as

new URI("/home/ayush/output/part-00000")

The latter creates a URI without a "protocol", and that could be problematic.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!