File not found error on cmd

i had tried to compile by cd C:\Program Files\Java\jdk1.6.0_24>javac HelloWorld.java
but it says the foll.error HelloWorld.java:1: error while writing the HelloWorld :HelloWorld.class<access is denied>
class HelloWorld{
1^ error
now plz help me with it ???
prog code is :
class HelloWorld {
public static void main(String args){
System.out.println(“Hello World!”);
}
}
i m using windows 7 home in compaq machine …

Where is HelloWorld.java located?

Open cmd and type javac, do you get command not found, or do you see the usage instructions?

If you saw the usage instructions, java is in Windows’ path and is properly installed.

Now, cd over to the directory where HelloWorld.java is and try javac HelloWorld.java.

If you still get the access denied error, then you’ll need to use Windows Explorer to give the ‘Everyone’ user read/write access to the directory your code is in.

javac shows me the instructions & i had already set the path in system variable under environment variable & my HelloWorld.java is located inside the jdk folder in c still it shows the access denied error…
& your last line -----“you’ll need to use Windows Explorer to give the ‘Everyone’ user read/write access to the directory your code is in.” how to do so ?

  • Open Windows Explorer
  • Navigate to the directory with HelloWorld.java in it
  • Right-click the directory
  • Select Properties
  • Click the Security tab
  • Click the Edit button
  • Click the Add button
  • Enter ‘everyone’ into the text box (no quotes, of course)
  • Click the Check Names button
  • Click Okay
  • Check the ‘Full control’ box in the Allow column
  • Click Okay
  • Click Okay
  • Wonder why Windows security has to be so ridiculously complicated
  • Done

Same scenario in Linux?

  • Open command prompt
  • Issue ‘chmod 777 <your directory>’ command
  • Done

done !! still error… but i m unable to check the last one i.e special permission , now what ?

hey dude …i have fix it …ta da thnx