title: JavaFX: "Toolkit" not initialized when trying to play an mp3 file through MediaPlayer class
body: <p>I'm trying to make a simple mp3 play in the background of my program using the following:</p>
  
  <pre><code>Media med = new Media(getClass().getResource("intro.mp3").toExternalForm());
  MediaPlayer mPlayer = new MediaPlayer(med);
  mPlayer.play();
  </code></pre>
  
  <p>The intro.mp3 file is placed in the bin folder of my package, along with the other .class files.</p>
  
  <p>The problem is that my program terminates with:</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalStateException: Toolkit not initialized
  </code></pre>
  
  <p>Full termination log is:</p>
  
  <pre><code>Device "Intel(R) HD Graphics Family" (\\.\DISPLAY1) initialization failed : 
  WARNING: bad driver version detected, device disabled. Please update your driver to at least version 8.15.10.2302
  
  Exception in thread "main" java.lang.IllegalStateException: Toolkit not initialized
      at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:153)
      at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:148)
      at javafx.application.Platform.runLater(Platform.java:52)
      at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:450)
      at javafx.scene.media.MediaPlayer.&lt;init&gt;(MediaPlayer.java:365)
      at PokerApp.&lt;init&gt;(PokerApp.java:33)
      at PokerApp.main(PokerApp.java:105)
  </code></pre>
  
  <p>Anybody have any ideas as per the cause of the problem?</p>