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

D

dave

(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...
 
A

Andrew Thompson

(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

]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top