Error to compile java program
When i comile the program using syntex ''javac filename.java'' in Dos
a message display on screen- 'JAVAC' is not recognized is as an internal or external command, operable program or batch file.
Please give me solution.
Computers & Internet - Sun - Java Programming Language (cdj-275)
Answers & Comments
The main cause of this error is you havent set the environment variables correctly, you can do it as follows
Right click on "My Computers" select properties the click "Environment variables" then under "User variables for pcname"
select new and add the following paths
1)var name:path
var value:C:\Java\jdk1.5\bin
2)var name:classpath
var value:C:\YourJavaCodeDirName
click ok and its done
First off I assume you actually installed a JDK already before trying to compile the code. If not then you need to do that.
Secondly this error is because Windows cannot find the javac executable on your command. It could be because the JDK is missing or not installed or that Windows does not know where to look to find javac.exe from. You can simply run javac with the full path instead
ex.
"C:\Program Files (x86)\Java\jdk1.7\bin\javac" filename.java
U c dat u had given a proper path
C:\path=path of ur file