Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: The project description file (.project) is missing

My project in eclipse was working all fine until I rebooted my system. On reopening the eclipse IDE, I started getting “Error: Could not find or load main class ...”. In the process to "fix" things, I deleted the .project file as well. (How very naive of me!) Now everything seems to be messed up. I cannot see my files being listed in the "Package Explorer". On opening the project it errors out saying: The project description file (.project) is missing. I still have all the source files and the compiled .class files in the respective directories.

Please help me out. Appreciate your suggestions.

Thank you!

I followed one of the suggestions (that of copying the .project file and modifying the project name). This brought back me to the stage where I could see all my files in the project explorer. But now on running the project from Eclipse, it is not able to find the Main method in the the java file (which actually contains the main()), and errors out as: Error: Main method not found in class , please define the main method as: public static void main(String[] args)

The main() method as I said is there. Its baffling how a project which I have been working on since 5 months with all things were working fine has suddenly become unusable. Could someone provide any insight on the latest error.

Thanks!

like image 576
user1639485 Avatar asked Nov 06 '12 08:11

user1639485


People also ask

Where can I find the .project file?

Click File > Open. Click Computer, and then on the right, choose a recent folder or click Browse. Click the project you want, and then click Open.

What is the .project file in Eclipse?

File created by Eclipse when creating a new project; saved in an XML format and contains the project name, build specifications, and dependencies; used for saving and loading projects into the Eclipse IDE; uses the filename .

What are .project files?

The most important type of output file is the project file. A project file contains all of the data you have imported, all of the parameters associated with each data file, the content of the journal, and several other collections of important data. All of this gets saved in a single, easily transportable file.


2 Answers

  1. Create a Dummy Project
  2. Take the .project file and modify this part

< name > PROJECT_NAME < / name >

  1. Place this in your old project
like image 176
madhairsilence Avatar answered Oct 18 '22 13:10

madhairsilence


Perhaps you could just create another one with something along the lines of this (saving it as .project in the project's directory):

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>Project Name</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
</projectDescription>
like image 27
Ren Avatar answered Oct 18 '22 14:10

Ren