Unable to read input from jar
<p>When I run <code>java -jar MidiTest.jar</code>, input a MIDI file, it throws:</p>

<pre>
Exception in thread "main" java.lang.NullPointerException
        at com.sun.media.sound.StandardMidiFileReader.getSequence(StandardMidi
leReader.java:209)
        at javax.sound.midi.MidiSystem.getSequence(MidiSystem.java:802)
        at MidiTest.playMidi(MidiTest.java:56)
        at MidiTest.(MidiTest.java:44)
        at MidiTest.main(MidiTest.java:25)
</pre>

<p>If I use <code>java MidiTest</code> instead it could play without issue. What wrong with the code? I have already add <code>Main-Class: MidiTest</code> with newline on Manifest file</p>

<p>My code:</p>

<pre><code>        private void playMidi() {
    if(isPlaying.equals("0")) {
        try {
            song = MidiSystem.getSequence(
                getClass().getResource(filename));
            sequencer = MidiSystem.getSequencer();
            sequencer.setSequence(song);
            sequencer.open();
            sequencer.addMetaEventListener(this);
            sequencer.start();
        } catch (InvalidMidiDataException e) {
            System.out.println("Bad midi file: "
                + filename);
            System.exit(1);
        } catch (MidiUnavailableException e) {
            System.out.println("No sequencer available");
            System.exit(1);
        } catch (IOException e) {
            System.out.println("Could not read: "
                + filename);
            System.exit(1);
        }
        displayMidiInfo(filename);
        } else {
        updateTempoFactor(speed);
        }
    }
</code></pre>
