Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 06-04-2006, 08:19 AM   #11 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

thanks for the reply

i types in java hello, but now i get the error message

exception in thread "main" java.lang.NoClassDefFoundError: hello
rookie1010 is offline  
Old 06-05-2006, 12:46 AM   #12 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Make sure you're in the directory that contains 'hello.class'.
jaeusm is offline  
Old 06-05-2006, 06:31 AM   #13 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

thanks for the reply

i have got the hello.class in the d:\ drive(root directory) and i am doing java hello from d:\

do i need to set any other parameter
rookie1010 is offline  
Old 06-05-2006, 12:37 PM   #14 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

It sounds like you have everything set up properly. Post your entire source code file if it's different from what you posted above.
jaeusm is offline  
Old 06-05-2006, 01:13 PM   #15 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

thanks for the reply

it is exactly the same,

i pasted the code in netbeans and it works fine
rookie1010 is offline  
Old 06-05-2006, 03:16 PM   #16 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Do you have a package declaration at the top of your source file?
jaeusm is offline  
Old 06-05-2006, 06:18 PM   #17 (permalink)
 
Master Techie

Join Date: Mar 2004

Posts: 2,069

rookie1010

Default

no i dont

the source file reads

public class hello
{
public static void main ( String[] args )
{
System.out.println("Hello World!");
}
}
rookie1010 is offline  
Old 06-13-2006, 12:31 PM   #18 (permalink)
 
Super Techie

Join Date: Sep 2005

Posts: 341

hillbillybob

Default

Your class name should always be capatilized. Your method names can never start with a capital letter, but class names, "Hello" in this case, should always be capitalized. That should solve the CLI NoClassDefFoundError problem.
__________________
The greatest measure of a nation is not it\'s army or economy, but by how many people are trying to get in, and how many people are staying!!
Guns, Guts, and Alcohol made America free.
Born American, Die American
Ubuntu - it\'s all about the bun\'s baby!!!
hillbillybob is offline  
Old 06-13-2006, 02:20 PM   #19 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Capitalization is a matter of style only. The compiler does not care if anything at all is capitalized.

As an aside, good programming style (in Java) dictates that you should capitalize the first letter of class names, but not method names or variable names. Regardless, this has nothing to do with actually compiling or executing the program.
jaeusm is offline  
Old 06-13-2006, 03:27 PM   #20 (permalink)
 
Super Techie

Join Date: Sep 2005

Posts: 341

hillbillybob

Default

jaeusm, I stand corrected. I know from experience that when ever I had that error it had to deal with the lack of capitalization. However, you were right, according to the documentation for java, you are not required to capatilize class names.
__________________
The greatest measure of a nation is not it\'s army or economy, but by how many people are trying to get in, and how many people are staying!!
Guns, Guts, and Alcohol made America free.
Born American, Die American
Ubuntu - it\'s all about the bun\'s baby!!!
hillbillybob is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On