0

I found a sample code of how to play an mp3 file. I installed the Java Media Framework as the instructions say, but then I still get this from Eclipse:

the import javax.media cannot be resolved

on the first line of

import javax.media.*;

Any ideas?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • have you checked that it is definetly added to the classpath? – Theolodis Feb 05 '14 at 12:33
  • possible duplicate of [Eclipse missing imports (javax.media.\* and com.sun.media.\*)](http://stackoverflow.com/questions/16163524/eclipse-missing-imports-javax-media-and-com-sun-media) – Theolodis Feb 05 '14 at 12:34
  • Um truth is no. How can this be done? –  Feb 05 '14 at 12:34
  • @Theolodis *"Have you checked that `it` is definitely added to the classpath?"* What is ***it***? – Ian Boyd Jun 29 '22 at 18:26
  • @IanBoyd that comment has been made 8 years ago, so I am not 100% sure, but my best guess would be that `it` refers to the Java Media Framework – Theolodis Jun 30 '22 at 13:24

1 Answers1

1

Here They solved that problem by rebuilding the project path in eclipse. You might want to try that.

Community
  • 1
  • 1
Theolodis
  • 4,977
  • 3
  • 34
  • 53
  • Ok everything is ok now but when I run the code I get this: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at AudioPlay.main(AudioPlay.java:23) –  Feb 05 '14 at 13:02
  • When you start the program you have to set the command argument to the path, where the mp3 is located. `File f=new File(args[0]);` In eclipse you can do that in the run configuration. – Theolodis Feb 05 '14 at 13:10