473,657 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception in thread "main" java.lang.NoCla ssDefFoundError

(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.NoCla ssDefFoundError : 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.prin tln("Specify file name to play");
System.exit(-1);
}
File file = new File(args[0]);
URL url = file.toURL();
AudioClip clip = Applet.newAudio Clip(url);
clip.loop();
//Wait 30 seconds
Thread.sleep(30 000);
System.exit(0);
}
}

THIS IS MY SYSTEM SETTINGS, ENVIR VAR"S ETC.
SET PATH=C:\j2sdk1. 4.2_05\bin;
SET
CLASSPATH=C:\j2 sdk1.4.2_05\bin ;c:\jakarta-tomcat-5.0.25\common\l ib\servlet-a
pi.jar
SET JAVA_HOME=C:\j2 sdk1.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 45737
"dave" <go************ ******@nowhere. com> wrote in message
news:M0******** ***********@nwr dny02.gnilink.n et...
(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.NoCla ssDefFoundError : PlayClip .... CLASSPATH=C:\j2 sdk1.4.2_05\bin ;c:\jakarta-tomcat-5.0.25\common\l ib\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\l ib\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******** ***********@nwr dny02.gnilink.n et...
(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.NoCla ssDefFoundError : 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.prin tln("Specify file name to play");
System.exit(-1);
}
File file = new File(args[0]);
URL url = file.toURL();
AudioClip clip = Applet.newAudio Clip(url);
clip.loop();
//Wait 30 seconds
Thread.sleep(30 000);
System.exit(0);
}
}

THIS IS MY SYSTEM SETTINGS, ENVIR VAR"S ETC.
SET PATH=C:\j2sdk1. 4.2_05\bin;
SET
CLASSPATH=C:\j2 sdk1.4.2_05\bin ;c:\jakarta-tomcat-5.0.25\common\l ib\servlet-a pi.jar
SET JAVA_HOME=C:\j2 sdk1.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
2993
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 webpage and installed it using SGI's swmgr application. The installation was very straight forward and there were no errors when I installed the package. Then I ran /usr/java2/bin/javac SelectSockets.java to make the SelectSockets.class file.
1
9109
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 version 1.4.0 and WMQ Series version 5.3 with CSD04. Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/server/MQSESSION at com.ibm.mq.MQSESSIONServer.getMQSESSION(MQSESSIONServer.java:67) at...
7
2759
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" java.lang.NoClassDefFoundError: I have several class files in the directory d:\personal\java-ChartGen Chart.class ChartColourScheme.class
4
2628
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 // Copyright and License import HelloApp.*; import org.omg.CosNaming.*;
9
3113
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
6434
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
3279
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 the following error Exception in thread "main" java.lang.NoClassDefFoundError: test Caused by: java.lang.ClassNotFoundException: test at java.net.URLClassLoader$1.run(Unknown Source) at...
4
14719
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 "appframework-1.0.3.jar;swing-worker-1.1.jar";CurrentStrobe.jar com.visionpro.currentstrobe.CurrentStrobeApp However, the statement below produces the error: java -cp "appframework-1.0.3.jar;swing-worker-1.1.jar" -jar CurrentStrobe.jar Exception in thread "main"...
3
7648
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 sortmergejoin.MergeJoin.Field(MergeJoin.java:204) at sortmergejoin.MergeJoin.SMJoin(MergeJoin.java:84) at sortmergejoin.MergeJoin.<init>(MergeJoin.java:34) at sortmergejoin.Main.main(Main.java:24) Java Result: 1"
1
6750
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 "main" java.lang.NullPointerException at java.awt.Container.addImpl(Container.java:1041) at java.awt.Container.add(Container.java:365) at orderingsystem.OrderingSystem.<init>(OrderingSystem.java:261) at...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8504
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6169
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2732
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1622
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.