user1507455
user1507455

Reputation: 1133

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

I set up my github account and egit. It works really well. I have learned the staging, committing, push/pulling ... pretty much.

Unfortunately (Juno) Eclipse is not recognizing FoobarProstate as a Java project. It says FoobarProstate is simply a project. When I click the green run arrow I get the error message

The selection cannot be launched and there are no recent launches.

I created the project in Eclipse, imported it with the wizard using File > Import > Git > Projects from Git. That might be my mistake.

This is what I see in the Eclipse Package Explorer.

Screenshot of Eclipse package explorer

What I've tried:

In the answers I've found online, it says to change the run configurations (Green run dropdown arrow > Run Configurations...). But the instructions are either not for Juno, or difficult to follow. I'm really confused.

Notes:

Thank you!

Upvotes: 3

Views: 4395

Answers (2)

Ivan T
Ivan T

Reputation: 1046

Try this: Right click on project name > Configure> Convert to Faceted Form> Choose in the appeared window Java and click 'OK'

Upvotes: 0

nitind
nitind

Reputation: 20003

The problem is likely that somewhere along the way, the original .project and .classpath files were lost. Together they indicate that the project is a Java Project and what its Java Build Path--including where your sources are within the project. Not physically being under the workspace directory should not be an issue.

The .project file contents should look something like this:

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

Upvotes: 5

Related Questions