Can't run project in eclipse after adding to repo. Not a java project

I have set up my github and egit account. It works really well. I learned about staging, locking, pushing / pulling ... pretty much.

Unfortunately (Juno) Eclipse does not recognize FoobarProstate as a Java project. It says FoobarProstate is just a project. When I click the green arrow, I get the error

The selection cannot be started and there are no recent starts.

I created a project in Eclipse, imported it using the File> Import> Git> Projects from Git wizard . This could be my mistake.

This is what I see in the Eclipse Package Explorer.

Screenshot of Eclipse package explorer

What I have tried:

  • Right click on the project name> Configure gives me one option: Convert to Maven project . I don't know what it is, and I don't think I want it.

  • The Green run> Run As dropdown menu gives me (not applicable).

  • I cannot understand the online instructions for going to a project in a java project.

The answers I found on the internet says to change the run configuration ( green run dropdown> Run config ... ). But the instructions are either not for Juno or difficult to follow. I am really confused.

Notes:

  • In the gitub view of my repos, it says "Java" next to that repo name! The repo has the same name (FoobarProstate) as my Java project.

  • My FoobarProstate files are stored in the C: \ Users \ EmilyBB \ git \ FoobarProstate folder. This is not my Eclipse workspace (C: \ Users \ EmilyBB \ workspace). This is problem?

  • I just installed Android stuff (ADT, etc.)

Thank!

+3


source to share


2 answers


Probably the problem is that the original .project and .classpath files were lost somewhere along the path. Together, they indicate that the project is a Java project and which Java build path it is — including where your sources are within the project. Not physically under the workspace directory shouldn't be a problem.

The content of the .project file should look something like this:



<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>YOUR 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>

      

+5


source


Try the following: Right click on the project name> Configure> Convert to faceted shape> Select Java in the window that appears and click OK



0


source







All Articles