error: pig bin hadoop apache

Problem

neils-MacBook-Pro:~ neil$ pig
Exception in thread "main" java.lang.NoClassDefFoundError: Energy/code/co-occurrence/Twitter
Caused by: java.lang.ClassNotFoundException: Energy.code.co-occurrence.Twitter
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

Solution

In my case it seemed to be caused by complicated path to pig:

/Users/neil/Documents/neil/Research/Twitter\ Energy/code/co-occurrence/Twitter\ Co-Occurrence\ Pig/var/pig/pig-0.8.0

It started working after changing to a simpler path

/Users/neil/tmp/pig

Make sure to set appropriate variables e.g.:

export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=/Users/neil/tmp/pig/bin:$PATH
export PIG_HOME=/Users/neil/tmp/pig:$PATH

keywords: osx pig hadoop map reduce mac local grant mapreduce map reduce

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*