• Post Reply Bookmark Topic Watch Topic
  • New Topic

unable to save .java file  RSS feed

 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am not able to save .java file. it says need administrator access, but i am logged in as an administrator account.
does anyone knows ??? solution.
Thanks
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't need admin rights to save a file unless you are trying to save it somewhere you shouldn't be like Program Files on a Windows system. What is your OS and where are you trying to save the file?
 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my os is windows 8.1
when i installed java, it gets automatically saved into system drive which is C.
so i am trying to save in c\program files\java
i am logged in as administrator.
but i am not able to save .java program files in c\program files\java folder
why is it like that?
thanks
 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because windows protects the Program Files folder (and others) to stop it being inadvertently (or maliciously) changed and potentially messing up your system.

You shouldn't be saving your .java files there anyway that's where the Java JDK goes, not your files. Create a folder somewhere away from windows folders and save the files there. On my system I have a D drive in which I have a projects folder. In that folder I have a sub folder for each of my programming projects and in each of those folders I have a SRC folder where the .java files go.
 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
but i was thinking .java files should be saved in folder where java is installed, which is C drive.
how can i install java in c drive and save .java files in folder in d drive.
Thanks
 
Stefan Evans
Bartender
Posts: 1837
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think of your .java files like any other document. You don't store word documents/spreadsheets in the same directory with the Microsoft office program do you? You store them in "My Documents" (or anywhere else you like to of course)

So just allocate a folder on your computer to use for "My Java Projects". It doesn't really matter which drive it lives on. I would suggest to keep it near the top of the folder hierarchy, and avoid using spaces in the folder names.

"c:\work\HelloWorld" works for me :-)



 
Raj Gurung
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok i see thanks for your suggestion.
i will try.
if any doubts i will query
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!