Solution to General PIG Installation Problems

I was setting up Pig for Hadoop on my Linux system having CentOS 7 and went through some issues. I had to spend some time to investigate these issues. I thought these solutions could be helpful for someone who is new to Linux or PIG platform and can save you time.
 
If you are new to Linux OS and trying to setup PIG or facing any of the issues given below it can be helpful for you. I can add if I will find more..
 
First make sure that you have setup Hadoop on your system properly.
 
Here is a link to to set up Hadoop on a Linux machine:

http://tecadmin.net/setup-hadoop-2-4-single-node-cluster-on-linux/
 
Problem 1: Exception in thread "main" java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant ?
 
Solution

Copy joda-time-2.5.jar which is located in pig-0.15.0 and pasted that at following location.

/hadoop/share/hadoop/common/

It is a hadoop's installation common directory.
 
You can find joda-time-2.5.jar from your downloaded pig .jar file.
 
Problem 2: Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/runtime/RecognitionException?
 
Solution:

Copy antlr-runtime-3.4.jar and paste it at following location:

/hadoop/share/hadoop/common/

It is a hadoop's installation common directory.
 
You can find joda-time-2.5.jar from your downloaded pig .jar file. 
 
Problem 3: org.apache.pig.Main - WARN: unable to write errors to log file pig_1463897579869.log
 
Solution:

type "pig -logfile <hadoop installation directory>/<pig installation directory>"
 
Problem 4: WARN org.apache.hadoop.util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable.

Solution:

Set "export LD_LIBRARY_PATH=<hadoop intstallation directory>/lib/native/:$LD_LIBRARY_PATH"
 
Problem 5: org.apache.pig.backend.executionengine.ExecException: ERROR 4010: Failed to register jar: <comma seperated list of jars>. Used in place of register command.. Caught exception.
 
Solution:

Check your 'pig.properties' file. all code should be commented there. Prefix "#" each line in file to comment each line.

You can find 'pig.properties' file using "find -name pig.properties". 
 
Note: These solutions assume that you have setup your pig using basic installation guidelines and are unable to run pig as required.