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

Home Posts Topics Members FAQ

getting error: java.lang.NoCla ssDefFoundError

Hi Guys,

im starting out in java and i'm getting the error: Exception in thread
"main" java.lang.NoCla ssDefFoundError : blurf

if i run "javac blurf.java", it compiles fine and without any troubles.

when i try to run it (its a simple hello world program) i get the above
error.

i need some help :)

-nat
Jul 17 '05 #1
3 6528
"NathanK" <me@me.com> wrote in message
news:40******@d uster.adelaide. on.net...
Hi Guys,

im starting out in java and i'm getting the error: Exception in thread
"main" java.lang.NoCla ssDefFoundError : blurf

if i run "javac blurf.java", it compiles fine and without any troubles.

when i try to run it (its a simple hello world program) i get the above
error.

i need some help :)

-nat


Most likely a classpath problem. Read about the java classpath in your book
or somewhere in the java tutorial at java.sun.com, which has been down all
day.

Try "java -classpath . blurf". If that works, the classpath is your problem.
Please post further questions in comp.lang.java. help.
Jul 17 '05 #2
NathanK wrote:
Hi Guys,

im starting out in java and i'm getting the error: Exception in thread
"main" java.lang.NoCla ssDefFoundError : blurf

if i run "javac blurf.java", it compiles fine and without any troubles.

when i try to run it (its a simple hello world program) i get the above
error.

i need some help :)

-nat

Two things, nat. 1) Ensure that you have a 'main' method, and 2) ensure
that if you are using a "package" statement (on top of the file), that
your directory structure matches.
-nat

Jul 17 '05 #3
NathanK <me@me.com> wrote in message news:<40******@ duster.adelaide .on.net>...
Hi Guys,

im starting out in java and i'm getting the error: Exception in thread
"main" java.lang.NoCla ssDefFoundError : blurf

if i run "javac blurf.java", it compiles fine and without any troubles.

when i try to run it (its a simple hello world program) i get the above
error.

i need some help :)

-nat


(1)Your current directory from where you issue javac/java command
shoud match the directory where your blurf.java/.class are stored.
(2)Your CLASSPATH should have . in it. Dot means current directory
wherever it is.

[autoexec.bat used in Win 95/98/Me]
SET CLASSPATH=.;%CL ASSPATH%

[other Windows]
Goto control panel.
Jul 17 '05 #4

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

Similar topics

3
3095
by: Christopher Vagnetoft | last post by:
E:\java\projects\console>javac -verbose HelloWorld.java
3
13893
by: Patrick Vanhoof | last post by:
Hi, I am starting to use Eclipse as development environment for Java. When I compile a small simple Java program I get the error below. Anyone knows what is wrong? All help very much appreciated. Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
1
47606
by: greg.knaddison | last post by:
Hi, I'm trying to use the httpclient within Jython (see http://jakarta.apache.org/commons/httpclient/ for more information on the httpclient). My Jython version is: Jython 2.1 on java1.4.2_04 (JIT: null) My Java version is:
3
15161
by: Bernd Oninger | last post by:
When I run the successfully compiled java source shown at the end I got a runtime error: Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content Where is the missing class ? I copied the newest jdom.jar from newest JDOM release b10 to the folder jdk\jre\lib\endorsed
0
1475
by: shanmukhi | last post by:
Hi All I got a problem in running java programs. i am not able to run java applet while running i got a problem as Loading Java Applet Failed java.lang.NoClassDefFoundError: App (wrong name: src/App) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source)
0
1041
by: UDAYGBHAT | last post by:
Hello every body....If any of you know the solution for this please do let me know....... javax.servlet.ServletException: com/sun/xml/parser/Resolver org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) org.apache.jsp.storedata_jsp._jspService(org.apache.jsp.storedata_jsp:101)...
5
2731
by: Ananthu | last post by:
Hi I have done all the codings part for connecting mysql server with java application but when i try to compile,the compilation is successful and during execution i get the following message, Exception in thread "main" java.lang.NoClassDefFoundError: MysqlConnect Coding Part: import java.sql.*; import java.lang.*;
1
1463
by: Vneha | last post by:
Hi class NewThread implements Runnable { Thread t; NewThread() { t = new Thread(this, "Demo Thread"); System.out.println("Child Thread:" + t); t.start(); }
8
2469
oll3i
by: oll3i | last post by:
when i run prograam from eclipse it works fine but when i run it from command line i get C:\ECLIPS~1\PD15\CLASSES\PD15>java D.... Exception in thread "main" java.lang.NoClassDefFoundError: D...(wrong nam e: pd15/D...) at java.lang.ClassLoader.defineClass1(Native Method)
0
8420
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
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,...
1
6176
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
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.