So after going through many posts on SO and revising some java basics, I still get this error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/io/Writable
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
at java.lang.Class.getMethod0(Class.java:2694)
at java.lang.Class.getMethod(Class.java:1622)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
I know the difference between java.lang.NoClassDefFoundError and ClassNotFoundException in Java, and have looked through what usually causes it. In a nutshell, it is because some class is unavailable to the program during Run Time but is available during Compile time. Hence I get no compile time errors.
I have added two classpaths, one to commons-logging-1.1.3.jar and the other to the hadoop-core.*jar.
I am pretty confident that the classpaths are correct.
Here are the imports in my Program
import java.io.*;
import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.SequenceFile.*;
import org.apache.hadoop.io.SequenceFile.Writer;
import org.apache.hadoop.io.*;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.*;
java -cp $JARSwhen you run your program?