I’m having problem with using external jars in my file. I always get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration`
at this line: `Configuration config = HBaseConfiguration.create();
And this file is on the classpath, I’m setting options when running jar:
$ java -jar hbase.jar -classpath "/usr/lib/hbase/*:/usr/lib/hadoop/*"
This file compiles successfully after invoking this command:
$ javac -classpath "/usr/lib/hbase/*:/usr/lib/hadoop/*" HBaseScanner.java
What to do?
My problem was that I was setting classpath using
-classpathoption and running jar, which causes the-classpathoption to be ignored.I have added jars in manifest file and this works.
This is similar problem: Setting multiple jars in java classpath