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

My execution lines in CMD are

D:\>cd jav 
D:\jav>javac fib.java  
D:\jav>fib java 

'fib' is not recognized as an internal or external command, operable program or batch file.

I could not understand the problem here.As i done with settings in environment variables but still i get this command.

Jon Skeet
people
quotationmark

You've got the command line round the wrong way. You want:

java fib

or preferably follow Java naming conventions, calling your class Fib rather than fib, and use

java Fib

(Even better, use packages - but that's probably the next step.)

When you compile a Java program, you end up with class files. That isn't a program which can just be launched from the command line - you have to start the JVM and tell that to launch your program... and that's what the java executable does.

people

See more on this question at Stackoverflow