Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-23-2005, 11:42 PM   #1 (permalink)
 
Newb Techie

Join Date: Dec 2005

Posts: 4

albert85

Default java problem

i can compile the java file successfully. but after i run it the error message:


Exception in thread "main" java.lang.NoClassDefFoundError: Welcome2

come out.
this is my sources code
someone can please help me

public class Welcome2
{
public static void main(String args[])
{
System.out.print( "welcome to");
System.out.println("Java Programming!");
}
}
albert85 is offline  
Old 12-24-2005, 02:07 PM   #2 (permalink)
 
Newb Techie

Join Date: Dec 2005

Posts: 11

snif innards

Default

I gave it a try and got no errors

the output was
Code:
welcome toJava Programming!

snif innards is offline  
Old 12-25-2005, 01:04 PM   #3 (permalink)
 
Super Techie

Join Date: May 2005

Posts: 479

furtivefelon

Default

did you give the file the same file name as the class name?
__________________
lisp hacker
running: FreeBSD 5.4 - still learning
develop with: SBCL + emacs for lisp, Anjuta IDE +gcc for c, SPE for python..
browse with: opera
furtivefelon 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