1

My problem currently is that I've got a project on bitbucket, and I've been able to create a local repository of the project through Eclipse.

However, when attempting to import the repository into Eclipse to run the project I come up against a couple of issues.

  1. Create a new project from the git repository. This does create a new project and links it to the local repo, but I'm not able to run is as a java project. The reason being that all of the options under the 'run configurations' are blank. And Eclipse doesn't recognise the project as a project at all.

  2. Create a java project first, and link it to the repo such that I can do push and pull to the repo. No idea how.

Any help would be hugely appreciated.

2 Answers 2

1

For option 1/, it could be as simple as to add the Java Nature to your current project (as seen also here).

Regarding the option 2/, you could create your java project, and then:

  • delete the project from your workspace (soft delete only, you wouldn't delete the files on the hard drive)
  • move the project files (ie .the .project, .classpath and sources) to the local git repo
  • import that project (in its new location) in your Eclipse workspace.
  • right click on them, select Team-> Share-> Git (and select your Git repo location), in order to mention to Eclipse that this project is managed by Git.
Sign up to request clarification or add additional context in comments.

3 Comments

that did the trick. I was missing the .project and .classpath files in the repo. Which was why I couldn't execute it as a java app.
@user1249379: Excellent! Creating a Java project (ie generating the right .project and .classpath) and then copying said project files in your Git repo is certainly easier than trying to add Java nature to those same files (as described in stackoverflow.com/questions/8070017/…).
0

I think importing the repository into Eclipse and running the project are different things.

To simplify the process, I always use "git clone xxx" to get a local repository. Then add an existing local git repository into Eclipse and create an existing java project from the cloned git repository respectively. In this way, I can run my project and control the repository.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.