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.

Followers

Pageviews Last 7 Days