Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Interpreter error

Thread view: 
ktaf - 23 Jun 2006 15:09 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.