2/03/2009

Change svn project to java project in Eclipse

I checked out a project from subversion repository using Eclipse (3.4.1 ganymede). I chose to check it out into a new Eclipse project, but it turned out to be a non-java, svn project was created. In the project properties, there is no associated builder. Its .project file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>project1</name>
<comment>project1</comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
Now I want to turn it into a java project so it can be built with a java builder. I tried a few menus and other places inside Eclipse to no avail. Then I found I can just edit .project file, and that did the trick. Close Eclipse before doing these manual editing.
$HOME/workspace/project1/.project:
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>project1</name>
<comment>project1</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>
I also added a .classpath file:
$HOME/workspace/project1/.classpath:
-----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<!-- change the default bin directory to classes directory -->
<classpathentry kind="output" path="classes"/>
</classpath>

Finally, start Eclipse, open project1, and modify its source path, libraries, and other project properties.

16 comments:

Josh said...

Try this:

between the natures tag, add a single nature tag with this in the middle

org.eclipse.jdt.core.javanature

see if that works.

-Josh

Unknown said...

Thanks Josh,

It's Worked.

jagdeesh333@gmail.com

Karen Sellers said...

If you create a blank java project first using the desired name and location, then checkout via svn, the project will remain a java project and hooked into the svn.

Anonymous said...

it works.. thanks alot

Anonymous said...

Worked like a charm, thanks

jazz said...

it really worked in my case.thanks!

Bobb said...

Well explained by you.That was helpfull

Unknown said...

Nice post it is very useful for me.
Each and every year we are providing Cheap and best students project at Madurai.

Unknown said...

Great and Useful Article.

Online Java Training

Java Online Training India

Java Online Course

Java EE course

Java EE training

Best Recommended books for Spring framework

Java Interview Questions








Java Course in Chennai

Java Online Training India

Unknown said...

I enjoyed on reading your blog post. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. Please visit my website, Friv 4000 Games is where all the free friv games.
Friv 4000

blogs said...

blogspot
hack7

Taylor Bara said...

THis is an old one. Do you have some new examples? Here is a new persuasive essay examples!

Dakota Leest said...

Writing critical essays is not the easiest task for many students. It might be extremely difficult to write such paper for those who have no critical thinking skills. I recently couldn't write a james welch fools crow summary and ordered it on Essaysbank.

meldaresearch said...

Dentistry Research Paper Writing Services have come up with Dentistry Writing Services for dentistry coursework writing service students in order for them to score straight A’s in their dentistry paper writing services.

Linda Tyler said...

I also work with such programming skills, I recently completed professional courses and have already received several orders. In this way, I will be able to earn extra money and develop in a new field. I have such an opportunity due to the fact that I trust the creation of research poster presentation to professionals http://essaysservice.com/research-poster-presentation.html

QualityEssays.co.uk said...

I had an opportunity to program now due to the website where I used to buy essays online uk related to this theme.