Computing.Net > Forums > Programming > NoClassDefFoundError in java

NoClassDefFoundError in java

Reply to Message Icon

Original Message
Name: deepadatta
Date: March 15, 2006 at 01:04:02 Pacific
Subject: NoClassDefFoundError in java
OS: Unix
CPU/Ram: 384 MB
Model/Manufacturer: Dell
Comment:

Hi,

I have written a simple program in java (hello.java) and it is throwing an exception as "Exception in thread "main" java.lang.NoClassDefFoundError : hello ". I have defined the public class "hello" and also properly set my classpath and I really don't know what is going wrong. Please help..

Thanks already,
Deepa


Report Offensive Message For Removal


Response Number 1
Name: DaveyB
Date: March 17, 2006 at 12:39:31 Pacific
Subject: NoClassDefFoundError in java
Reply: (edit)

I had this problem when I first started. This means that java cannot find your bytecode file. (hello.class)

As you can see your program hasn't been turned into bytecode.

so open the command prompt (Start-Run-Type "cmd")

locate the folder where your java source file is for example if it is located in a folder called app on your C: you would type
(cd c:\app) cd being change directory

then do a 'java hello'

If that doesn't work change your CLASSPATH variable with 'set CLASSPATH='

then do a 'java hello'

If none of this works send me an email and I will go through different things with you.


There are 10 sort of people that exist in this world, The ones who understand binary and the rest


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: NoClassDefFoundError in java

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge