Error: Unable to open class file R.java

Viewed 38277

Did a fresh install of Eclipse, JDK and android-sdk.

I am currently receiving this error when creating a new project

[2010-09-26 16:07:56 - Test] ERROR: Unable to open class file C:\workspace\Test\gen\com\example\test\R.java: No such file or directory

What's the reason for this and how do I fix it?

Eclipse Helios 32 bit
java version "1.6.0_21"
Android sdk API 8

P.S. I'm new to Android development.

EDIT: I tried most of your solutions, but nothing worked. So I started using my friend's install of Eclipse Ganymede.

21 Answers

Removing Read Only attribute on Eclipse workspace directory and Project->Clean->Build Project did the trick for me. I then clicked on the project directory from within Eclipse and did a F5 (Refresh) . R.java was generated in the gen folder.

Related