why this error

Arduino: 1.8.2 (Windows 7), Board: "Arduino/Genuino Uno"

unable to rename 'core\core.a'; reason: Permission denied

exit status 1 Error compiling for board Arduino/Genuino Uno.

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

Try "Save as". The files from the examples are write protected.

This error may be caused by your antivirus software. To check if that's the reason, TEMPORARILY disable your antivirus software for one compilation. If that causes the problem to go away then you will need to whitelist the appropriate folder or program in your antivirus software.

What if that does not work!!!

If it doesnt work you ruled out two common causes from the above posts and everyone moves to another stage of troubleshooting. Its that easy.