Raspberry PI GPIO Java Code Error
<p>Here Is the Console Log</p>

<pre><code>root@raspberrypi:/home/pi# java -jar /home/pi/keypad.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NullPointerException
        at me.Andrew.Keypad.GPIO.GPIOMethords.setupPins(GPIOMethords.java:33)
        at me.Andrew.Keypad.Listener.ButtonInput.ButtonListener(ButtonInput.java:45)
        at me.Andrew.Keypad.Listener.ButtonInput.start(ButtonInput.java:22)
        at me.Andrew.Keypad.Main.main(Main.java:15)
        ... 5 more
root@raspberrypi:/home/pi#
 unavailable)
</code></pre>

<p>Here is the code</p>

<p>GPIOMethords</p>

<pre><code>public class GPIOMethords {
public Main MA;
public Settings settings = new Settings();
final GpioController gpio = GpioFactory.getInstance();

public HashMap&lt;String,GpioPinDigitalInput&gt; ColPins = new HashMap&lt;String,GpioPinDigitalInput&gt;();
public HashMap&lt;String,GpioPinDigitalOutput&gt; RowPins = new HashMap&lt;String,GpioPinDigitalOutput&gt;();

public void setupPins(){
    if(ColPins.isEmpty()){
        ColPins.put("1",gpio.provisionDigitalInputPin(settings.Col1));
        ColPins.put("2",gpio.provisionDigitalInputPin(settings.Col2));
        ColPins.put("3",gpio.provisionDigitalInputPin(settings.Col3));
        ColPins.put("4",gpio.provisionDigitalInputPin(settings.Col4));
    }
    if(RowPins.isEmpty()){
        RowPins.put("1",gpio.provisionDigitalOutputPin(settings.Row1));
        RowPins.put("2",gpio.provisionDigitalOutputPin(settings.Row2));
        RowPins.put("3",gpio.provisionDigitalOutputPin(settings.Row3));
        RowPins.put("4",gpio.provisionDigitalOutputPin(settings.Row4));
    }
    MA.store.ColPins = ColPins; // line 33
    MA.store.RowPins = RowPins;
}


}
</code></pre>

<p>Main </p>

<pre><code>public class Main {
    private static Main instance = null;

    public Settings set = new Settings();
    public static Methords Meths = new Methords();
    public GPIOMethords GPIOMeths = new GPIOMethords();
    public Storage store = new Storage();

    public static void main(String[] args) {
            Meths.buttonIn.start();

    }
    public static Main getInstance() {
          if(instance == null) {
             instance = new Main();
          }
          return instance;
       }

}
</code></pre>

<p>Settings</p>

<pre><code>public class Settings {
public String Code = "ABCD";

//Define Row Pins!
public Pin Row1 = RaspiPin.GPIO_00;
public Pin Row2 = RaspiPin.GPIO_01;
public Pin Row3 = RaspiPin.GPIO_02;
public Pin Row4 = RaspiPin.GPIO_03;

//Define Col Pins!
public Pin Col1 = RaspiPin.GPIO_04;
public Pin Col2 = RaspiPin.GPIO_05;
public Pin Col3 = RaspiPin.GPIO_06;
public Pin Col4 = RaspiPin.GPIO_07;

}
</code></pre>