• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error- Access is denied  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I compiled file but got below error

C:\Program Files\Java\jdk1.6.0_25\bin>javac MooseGreetings.java

MooseGreetings.java:1: error while writing MooseGreetings: MooseGreetings.class
(Access is denied)
public class MooseGreetings {
^
1 error
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Jatin Guptaa wrote:
C:\Program Files\Java\jdk1.6.0_25\bin>javac MooseGreetings.java

Looks like you have your java file under the JAVA_HOME/bin. Bad idea.
Move it to somewhere else, e.g your home directory or desktop or better still create a directory called 'workspace' under your home and try again. Most probably write access is denied for directories under Program Files (I am not using Windoze, so can't say for sure). Though I confess how you managed to save your java file there in the first place

 
Jatin Guptaa
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, it works.
Thanks
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!