473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Exception in thread "main" java.lang.NoClassDefFoundError

(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
Jul 17 '05 #1
2 45729
"dave" <go******************@nowhere.com> wrote in message
news:M0*******************@nwrdny02.gnilink.net...
(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 .... CLASSPATH=C:\j2sdk1.4.2_05\bin;c:\jakarta-tomcat-5.0.25\common\lib\servlet-a pi.jar


Please observe netiquette and common sense. Caps are not required to
differentiate comments from code. Thousands upon thousands of messages have
gotten along just fine in the comp.lang.java.* groups without using all
caps.

Your problem is almost certainly that PlayClip.class is not in your
classpath. This is what the classpath is for: to tell Java where to find
classes you're trying to use. Use "java -classpath . PlayClip" to
temporarily add the current directory to the classpath. There's little
reason to have "C:\j2sdk1.4.2_05\bin" in your classpath, and
"c:\jakarta-tomcat-5.0.25\common\lib\servlet-api.jar" would likely be better
off elsewhere as well, like in a projects properties or settings.

Finally, in the future please post simple issues like this to
comp.lang.java.help and more advanced ones to comp.lang.java.programmer.
This group is not supposed to exist.
Jul 17 '05 #2
It was actually b/c i didn't enter ---> .;
before CLASSPATH= and PATH=

Believe it or not, I do appreciate your critique of my netiquette and will
keep this in mind. I apologize.

"dave" <go******************@nowhere.com> wrote in message
news:M0*******************@nwrdny02.gnilink.net...
(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

---
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
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phillip Montgomery | last post by:
Hello all; I'm trying to debug an issue with a java script called, SelectSockets. It appears to be a fairly common one found on the web. I downloaded the SGI Java v1.4.1 installation from SGI's...
1
by: Andy Howells | last post by:
Can anybody help me on this? I am getting the below error but have not got a clue why. The file in my classpath eing used has the class that it says is not defined. Any ideas? I am running java...
7
by: news | last post by:
I am pretty new to Java and I just install the JDK1.4.2 03 I am getting an error when I run the class file TestChart.class with the java.exe: Exception in thread "main"...
4
oll3i
by: oll3i | last post by:
when i try to run the client application java HelloClient -ORBInitialPort 1050 -ORBInitialHost localhost i get an error exception in thread "main" java.lang.NoClassDefFoundError:HelloClient ...
9
by: jith87 | last post by:
What is ths error.????? I m nw loading the JDBC driver for connection with MySql. Exception in thread "main" java.lang.NoClassDefFoundError: MySQLJDBCDriverTest
3
by: Ananthu | last post by:
Hi This is my codings in order to access mysql database from java. Codings: import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement;
9
by: tiyaramunna | last post by:
I am trying to configure my system with Java program just to practice on the coding....when i compile a test.java program i am able to see the class file but i cant run the program ... I am getting...
4
by: jmitch89 | last post by:
I don't why I get this error: Exception in thread "main" java.lang.NoClassDefFoundError The statement below works just fine: java -cp...
3
by: ohadr | last post by:
hi, i get Exception in thread "main" java.lang.NullPointerException when i run my application. the exact error is: "Exception in thread "main" java.lang.NullPointerException at...
1
by: onlinegear | last post by:
HI i am writing this for college i know i have loads of combo boxes with nothing in the i havent got that far yet. but every time i run this is comes up with this erro run: Exception in thread...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.