简体   繁体   中英

How to get a path of a folder in cloudera?

Im trying to run a my code in java using hadoop but I get an error of the path of the file

 scanner1 = new Scanner(new File("/home/cloudera/pos.txt")); //Path

The error message that I get is:

Status : FAILED java.io.FileNotFoundException: /home/cloudera/pos.txt (Permission denied)

The "Permission denied" in the error message indicates you don't have read access to the directory. Which user is running the java code, your personal user or the cloudera? To fix, you should either make the data readable for your user, move it to a common location that is globally readable, think /usr/local, or run your code as the cloudera user. Also, is this in HDFS or on the local filesystem?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM