Eclipse problem – Cannot find the class file for java.lang.Object

It’s quite hateful that Eclipse always generates hidden files .project and .classpath in project folder. Sometimes you’re not awared if something goes wrong in these files.

After upgrading your Eclipse and if you found the following compile error, I’d suggest you to check .classpath in your project folder.

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project

Most likely you would see a line like this.

<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/j2re1.4.2_03"/>

The stupid Eclipse appended this for no reason. Just simply remove it to make it work again. ;)
/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/j2re1.4.2_xx

Sayed’s thoughts: Upgrading eclipse

15 comments
  1. Deepa said:

    this is not the problem in my case. what further can i do to solve this prob

  2. Haukur said:

    Well, it *was* the problem in my case. Thank you!

  3. Matt said:

    This fixed my problem as well. To be clear, the resulting string value for the path attribute should be: “org.eclipse.jdt.launching.JRE_CONTAINER/”

    Thanks!

  4. Bilkis said:

    Still problem is not solved

  5. hochit said:

    So, what’s your problem exactly?

  6. Mikael said:

    That worked for me!

    Cheers,

    //mikael

  7. hochit said:

    For anyone found it worked or not worked, please quote your Eclipse version as well. Since I haven’t updated my Eclipse long time. I also want to know if the hack can apply to newer versions. Thanks!

  8. Carlos said:

    worked for me. I’m using 3.1.0 though.

  9. Binoy said:

    Kind Status Priority Description Resource In Folder Location
    Error The project was not built since its classpath is incomplete. Cannot find the class file for javax.xml.rpc.ServiceException. Fix the classpath then try rebuilding this project. iimsweb_rpt

  10. Tiago said:

    It has worked for me too.
    Thank you.
    (Stupid Eclipse!)

  11. Dude said:

    Doesn’t work for me either! Using Eclipse 3.10 on Ubuntu Linux 7.10.

  12. zaxon said:

    I had the same error even though the .classpath file seemed OK. I went to project properties, Java Build Path and removed “JRE System Library” entry. Then “Replace With -> Latest from HEAD” the .classpath file. The error was gone.

  13. Opita said:

    The complete line, fixed for me, looked like:

    Thank u for your tip

  14. Rob shields said:

    Thanks man – experienced something similar in Netbeans…removing and adding the libraries worked.

  15. sreeniketh1974 said:

    Adding this line in the .classpath file solved the problem for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 340 other followers

%d bloggers like this: