hi all i use the javazoom.jl.player.Player package but it is says The import javazoom cannot be resolved. i am using eclipse and doing Android project. i clean the project still the same error is shown. please correct me.
Asked
Active
Viewed 1.2k times
2
-
Compiler error (red lines in the editor)? Runtime error (on the device/emulator)? – Andreas Dolk Apr 15 '11 at 12:28
-
it is Compiler error(red lines in editor) – M.A.Murali Apr 15 '11 at 12:46
-
it is compiler error(red lines in the editor) – M.A.Murali Apr 15 '11 at 12:49
2 Answers
5
If eclipse can't resolve a package fragment of an import statement, then it tells you (with that error), that there is no library on the classpath that contains a class from that package (or from a package whose name starts with the missing part).
An easy way for standard java/eclipse:
- create a folder
lib
in your projects root directory (with the eclipse workbench!) - copy and paste the jar into that folder
- right-click the copied jar and select "add to build path".
This should eliminate the compiler errors immediately.
(Previous part of the answer)
Taking the error message literally, it looks like you have a line of code like that:
import javazoom;
This would be wrong, because we don't import packages but classes from a package. To import all classes from the javazoom
package, we'd say:
import javazoom.*;

Andreas Dolk
- 113,398
- 19
- 180
- 268
-
i am using like this import javazoom.jl.player.Player; if use import javazoom.*; the same error is repeated. – M.A.Murali Apr 15 '11 at 12:48
-
Understand - so you have a red line under the word `javazoom` in the import statement. – Andreas Dolk Apr 15 '11 at 12:53
-
i did the following but i have the same error (compile error). my project structure is: my project name is Bpm. i created a folder called lib under Bpm. and paste the jlayer1.0.1.zip in the folder. and right click the zip build path->add to build path. please guide me. – M.A.Murali Apr 15 '11 at 13:27
1
You should download the .jar of jLayer ( http://www.javazoom.net/javalayer/sources.html )
And add into classpath in the way Andreas_D told you.

Marcos Vasconcelos
- 18,136
- 30
- 106
- 167
-
i did the following but i have the same error (compile error). my project structure is: my project name is Bpm. i created a folder called lib under Bpm. and paste the jlayer1.0.1.zip in the folder. and right click the zip build path->add to build path. please guide me – M.A.Murali Apr 15 '11 at 13:28
-
Open this zip, and get the jLayer.jar from there, this is the file you should add to classpath. – Marcos Vasconcelos Apr 15 '11 at 13:37