Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: java com.sun.media.codec.audio.mp3.JavaDecoder  (Read 4645 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: September 17, 2007, 08:02:21 AM »

I just downloaded JMF from this site: http://java.sun.com/produ...dia/jmf/mp3/download.html / http://java.sun.com/produ...a/jmf/2.1.1/download.html but when i run this line: java com.sun.media.codec.audio.mp3.JavaDecoder to complete the install as instructed I get this error:

Quote
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/media/codec
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I know it's a classpath problem but i'm not sure where to look.. the setup should install the files in: C:\Program Files\Java\jre1.6.0_01\lib\ext where "jre1.6.0_01" is the java version. It did installed the plugin file in the EXT directory but when i want to test the plugin with code from the sun forum ( http://forum.java.sun.com...352&messageID=3565801 ):

Code
GeSHi (java):
  1.  
  2. import javax.media.*;
  3. import java.io.*;
  4.  
  5. public class PlayMP3Thread
  6. extends Thread
  7. {
  8.  
  9. private URL url;
  10.  
  11. public PlayMP3Thread(File mp3)
  12. {
  13. this.url = mp3.toURL();
  14. }
  15.  
  16. public void run()
  17. {
  18. try
  19. {
  20. MediaLocator ml = new MediaLocator(url);
  21. Player player = Manager.createPlayer(ml);
  22. player.addControllerListener(
  23.  new ControllerListener()
  24.  {
  25.  public void controllerUpdate(ControllerEvent event)
  26.  {
  27.  if (event instanceof EndOfMediaEvent)
  28.  {
  29.  player.stop();
  30.  player.close();
  31.  }
  32.  }
  33.  }
  34. );
  35. player.realize();
  36. player.start();
  37. }
  38. catch (Exception e)
  39. {
  40. e.printStackTrace();
  41. }
  42. }
  43.  
  44. }
Created by GeSHI 1.0.7.20

the library cannot be found. Any suggestions?

« Last Edit: September 17, 2007, 08:26:57 AM by HappyFace » Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #1 on: September 17, 2007, 08:43:31 AM »

nvm it works, i needed to restart the pc. :)
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
gluk
Member
*

Reputation: 0
Offline Offline
Posts: 22
Referrals: 0

Awards
« Reply #2 on: April 21, 2009, 05:45:32 PM »

The solution for most of the Java related errors can be found at this site: Java errors and solutions.
« Last Edit: April 22, 2009, 12:46:33 PM by HappyFace » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here