Reputation: 21
I am new to Java and its my first program in Java, I am trying to run HelloWorldApp program but its giving an error
c:\Program Files (x86)\Java\jdk1.6.0_14\bin>javac HelloWorldApp.java"
HelloWorldApp.java:5: error while writing HelloWorldApp: HelloWorldApp: HelloWorldApp.class (Access is denied)
public class HelloWorldApp(
1 error
I wrote the given code in NotePad and saved that in C:\Program Files (x86)\Java\jdk1.6.0_14\bin
public class HelloWorldApp{
public static void main(String[] args){
System.out.println("Hello World");
}
}
Upvotes: 0
Views: 2762
Reputation: 337
You don't have access to folder where You put class file. Move file to another folder where you have proper permission or run that command as administrator.
Upvotes: 0
Reputation: 384
The error clearly says access denied. Get admin rights for the java folder or place your class file in a different directory for which you have admin rights and try to run.
Upvotes: 0
Reputation: 950
Put in a folder where administrator rights isn't required. Eg on your desktop. Then open cmd.exe and type cd C:\path\to\file
. Finally use the same javac command.
Upvotes: 4