Access restriction: The type Player is not accessible due to restriction on required library C:\Program Files (x86)\Java\jre7\lib\ext\jmf.jar
<p>I'm trying LiveAudioStreaming in java. For livestreming through JMF. I'm getting following error.
Access restriction: The type Player is not accessible due to restriction on required library C:\Program Files (x86)\Java\jre7\lib\ext\jmf.jar. 
Please help.  <a href="https://buddhimawijeweera.wordpress.com/2011/05/01/how-to-play-audio-and-video-files-in-java-applications/" rel="nofollow">I used code from this link</a></p>

<p>Here is the code:</p>

<pre><code>package com.simpleaudioplayer.simpleaudioplayer;

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import javax.media.*;   // import JMF classes
import javax.swing.JFileChooser;

public class Main {
    private Player audioPlayer = null;

    public SimpleAudioPlayer(URL url) {
        try {
            //MediaLocator ml=new MediaLocator(url);
            audioPlayer = Manager.createPlayer(url);
        } catch (Exception ex) {
            System.out.println(ex);
        }
    }

    public SimpleAudioPlayer(File file) throws MalformedURLException {
        this(file.toURI().toURL());
    }

    public void play() {
        audioPlayer.start(); // start playing
    }

    public void stop() {
        audioPlayer.stop();  //stop playing
        audioPlayer.close();
    }

    public static void main(String[] args) {
        try {
            // TODO code application logic here
            JFileChooser fc = new JFileChooser();
            fc.showOpenDialog(null);
            File file = fc.getSelectedFile();
            SimpleAduioPlayer sap = new SimpleAduioPlayer(file);
            sap.play();
            //sap.stop();
        } catch (MalformedURLException ex) {
            System.out.println(ex);
        }
    }
}
</code></pre>