473,320 Members | 1,982 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,320 software developers and data experts.

getting error: java.lang.NoClassDefFoundError

Hi Guys,

im starting out in java and i'm getting the error: Exception in thread
"main" java.lang.NoClassDefFoundError: 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 6501
"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.NoClassDefFoundError: 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.NoClassDefFoundError: 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.NoClassDefFoundError: 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=.;%CLASSPATH%

[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
by: Christopher Vagnetoft | last post by:
E:\java\projects\console>javac -verbose HelloWorld.java
3
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...
1
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...
3
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 ?...
0
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...
0
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...
5
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, ...
1
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
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"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.