Welcome to *JimsWorld*

Latest bYte'Z for u r daily Bit(e)'Z….

Common errors in java programming..

Posted by jimstech on March 29, 2009

'javac' is not recognized as an internal or external command, operable program or batch file:

If you receive this error, Windows cannot find the compiler (javac).

Here’s one way to tell Windows where to find javac. Suppose you installed the JDK in C:\jdk6. At the prompt you would type the following command and press Enter:

C:\jdk6\bin\javac HelloWorldApp.java

If you choose this option, you’ll have to precede your javac and java commands with C:\jdk6\bin\ each time you compile or run a program.

Syntax Errors:

If you mistype part of a program, the compiler may issue a syntax error. The message usually displays the type of the error, the line number where the error was detected, the code on that line, and the position of the error within the code. Here’s an error caused by omitting a semicolon (;) at the end of a statement:

testing.java:14: `;' expected.
System.out.println("Input has " + count + " chars.")
                                                     ^
1 error

To know Additional details about classes and their functions,CLICK HERE

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: