Error message when running simple Java pgm

Reply

Join Date: Aug 2004
Posts: 2
Reputation: aperez is an unknown quantity at this point 
Solved Threads: 0
aperez aperez is offline Offline
Newbie Poster

Error message when running simple Java pgm

 
0
  #1
Aug 3rd, 2004
used following in MS-DOSS command window

public class Welcome1 {
/*method*/
public static void main( String args [])
{
System.out.println( "Welcome to Java Programming!" );
}/*end main*/
}/*end class Welcome1*/

It was taken as an elementry example of a Jova pgm.

I saved it as Welcome1.java and used the MS-DOS command line, > java Welcome1 There was a momentary hesitation and I received the following Error message

Exception in thread "main" Java.lang.NoClassDefFoundError:Welcome1

I'm trying to learn Java on my own. I'd like some help in taking this first step. Any suggestions????

TonyPerez
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Error message when running simple Java pgm

 
0
  #2
Aug 3rd, 2004
Heres a dumb question... did you compile it first?
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 1,749
Reputation: nanosani is an unknown quantity at this point 
Solved Threads: 55
Team Colleague
nanosani's Avatar
nanosani nanosani is offline Offline
Unauthenticated Liar

Re: Error message when running simple Java pgm

 
0
  #3
Aug 3rd, 2004
use javac Welcome1.java
and then use

java Welcome1
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 2
Reputation: aperez is an unknown quantity at this point 
Solved Threads: 0
aperez aperez is offline Offline
Newbie Poster

Re: Error message when running simple Java pgm

 
0
  #4
Aug 4th, 2004
Originally Posted by nanosani
use javac Welcome1.java
and then use

java Welcome1

At the dos command prompt I tried "javac Welcome1.java" and I get...... 'javac' is not recognized as an internal or external command, operable program or batch file.
Reply With Quote Quick reply to this message  
Join Date: Jul 2003
Posts: 117
Reputation: Iron_Cross is an unknown quantity at this point 
Solved Threads: 2
Iron_Cross's Avatar
Iron_Cross Iron_Cross is offline Offline
Junior Poster

Re: Error message when running simple Java pgm

 
0
  #5
Aug 4th, 2004
You need to add it to your system variables. It depends on what OS you're running as to how to do this. Or you could just type in the full path name like:

C:\Program Files\Sun\JavaSDK\bin\javac.exe program.java
C:\Program Files\Sun|JavaSDK\bin\java.exe program

Of course, your's is probably different. But youshould get the idea.
elitehackers.info
Today's Penny-Arcade!
Pain is weakness leaving the body!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC