Make Eclipse recognize your scala source files

Scala programming language logo

If you use the Eclipse and if you mix Java and Scala source files in the same project, Eclipse might not recognize the Scala ones.

To make it recognize them you’ll have to modify the .project file in particular buildSpec and natures tags :

<buildSpec>
	<buildCommand>
		<name>org.scala-ide.sdt.core.scalabuilder</name>
		<arguments>
		</arguments>
	</buildCommand>
</buildSpec>
<natures>
	<nature>org.scala-ide.sdt.core.scalanature</nature>
	<nature>org.eclipse.jdt.core.javanature</nature>
</natures>

Or simply by going to the menu :
Right click on your project -> Configure -> Add Scala Nature

And that’s it.

Leave a Reply