Hi
I wrote a simple Java application from Deitel book.It is compiled by
JDK1.5 and .class file is generated but when i invoke interpreter by
java command , an error message was displayed.The error said:
Exception in thread "main" java.lang.NoClassDefFoundError: Welcome1
The code is :
public class Welcome1 {
public static void main( String args[] )
{
System.out.println( "Welcome to Java Programming!" );
}
}
I saved this program as Welcome1.java
and compiled it by javac Welcome1.java
and invoked interpreter by java Welcome1
I have installed JBuilder2006 but i don't use it beacause i am a novice
yet.
When i write another Java applications from Deitel book , the similar
error message is displayed.
Alex - 23 Jun 2006 15:19 GMT
> Hi
> I wrote a simple Java application from Deitel book.It is compiled by
[quoted text clipped - 20 lines]
> When i write another Java applications from Deitel book , the similar
> error message is displayed.
This sound like the error I first got. Does it work if you type in the
command line:
"set CLASSPATH=" and the try "java Welcome1"? If so then you need to
change your class pass variables. You can do this on a Windows machine
by going to Control Panel - System - Advanced and choosing the
Environment Variables and removing any path name that's listed under
CLASSPATH.
Alex
Moiristo - 23 Jun 2006 15:36 GMT
>> Hi
>> I wrote a simple Java application from Deitel book.It is compiled by
[quoted text clipped - 16 lines]
>> and compiled it by javac Welcome1.java
>> and invoked interpreter by java Welcome1
Try: java -cp . Welcome1