Java Interface for writing and reading data on hdfs

You showed us how to copy files from hdfs using the command prompt. I am trying to do the same thing from a java interface. An example is shown in the book: " Hadoop the definite guide" on page 56.
When I run the program, I receive this error:
Exception in thread "main" java.lang.NoClassDefFoundErro: URLCat
Could not find the main class: URLCat. Program will exit.

I have read online for solutions but it is not working. I saved my java codes in a jar file under /cloudera/lib

Can you help me out on this?

1 Answer(s)


hi Yaw,

One reason for "NoClassDef" error is because you are referring to a class with a wrong name. Please check the package name/classfile.