Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find the class file for java.lang.Object

Tags:

I reinstalled my eclipse. and then imported all the projects in the Eclipse, but every project has a common error:

Cannot find the class file for java.lang.Object. at Line 1.

I have checked my Java Path. But not able to sort it out.

like image 938
Veer Shrivastav Avatar asked Apr 02 '13 06:04

Veer Shrivastav


People also ask

Where can I find class file in eclipse?

To get there, we go to the menu under Navigate > Open Type in Hierarchy or we use the shortcut: Ctrl + Shift + H on a PC or Cmd + Shift + H on a Mac. This dialog is similar to the Open Type dialog. Except for this time when we click on a class, then we get the Type Hierarchy view.

How do I view a .class file?

A simple way to see what String literals are used in a ". class" file is to use the javap utility in your JDK installation to dump the file using the "-v" option. Then grep for text that looks like <String "..."> where ... is the String you are looking for.


2 Answers

Right click on Project--> Properties, Java Build Path.

enter image description here

Check whether you have JRE installed. If installed click on EDIT and check whether its pointing to correct location

enter image description here

like image 84
Hardik Mishra Avatar answered Sep 23 '22 22:09

Hardik Mishra


Check this if it works:

There is a problem with your java repositories. I guess..:

goto Help>Install New Software> Click on Add Button .

on popup:

Name: ADT

Location:https://dl-ssl.google.com/android/eclipse

Install all the available softwares in the list. This may work.

Have a good day!!!

like image 21
Sharda Singh Avatar answered Sep 20 '22 22:09

Sharda Singh