Exception in thread "main" java.lang.NoClassDefFoundError:

Discussion in 'Java' started by dave, Jul 16, 2004.

  1. dave

    dave Guest

    (Forgive all caps... they are there to differentiate btw question and code)

    THIS IS THE ERROR I KEEP GETTING. IT COMPILES BUT WHEN IT RUNS, THE
    FOLLOWING POPS UP:
    Exception in thread "main" java.lang.NoClassDefFoundError: PlayClip

    THIS IS MY CODE:
    import java.applet.*;
    import java.io.*;
    import java.net.*;

    public class PlayClip {
    public static void main(String args[]) throws Exception{
    if(args.length == 0){
    System.err.println("Specify file name to play");
    System.exit(-1);
    }
    File file = new File(args[0]);
    URL url = file.toURL();
    AudioClip clip = Applet.newAudioClip(url);
    clip.loop();
    //Wait 30 seconds
    Thread.sleep(30000);
    System.exit(0);
    }
    }

    THIS IS MY SYSTEM SETTINGS, ENVIR VAR"S ETC.
    SET PATH=C:\j2sdk1.4.2_05\bin;
    SET
    CLASSPATH=C:\j2sdk1.4.2_05\bin;c:\jakarta-tomcat-5.0.25\common\lib\servlet-a
    pi.jar
    SET JAVA_HOME=C:\j2sdk1.4.2_05
    SET TOMCAT_HOME=c:\jakarta-tomcat-5.0.25
    SET CATALINA_HOME=c:\jakarta-tomcat-5.0.25

    ANY IDEA WHY THIS IS HAPPENING? I CAN AND IN FACT ARE RUNNING AND COMPILING
    SREVLETS TO TOMCAT...



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.720 / Virus Database: 476 - Release Date: 7/14/04
     
    dave, Jul 16, 2004
    #1
    1. Advertising

  2. On Fri, 16 Jul 2004 12:41:13 GMT, dave wrote:

    > (Forgive all caps... they are there to differentiate btw question and code)


    <code>
    ....
    </code>

    Might be a better way than shouting.

    > Exception in thread "main" java.lang.NoClassDefFoundError: PlayClip


    This sounds like a very noobish error, are
    you using an IDE to compile and launch? What
    are the exact commands you are using to both
    compile and launch the application?

    [ BTW - did you try..

    java -cp . PlayClip

    ]

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jul 16, 2004
    #2
    1. Advertising

  3. dave

    Roedy Green Guest

    Roedy Green, Jul 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page