2009-05-01

Mixing Java and Scala in an Eclipse Project

If you start a project off as a Scala project, then it's OK to mix in some Java source. Everything will be compiled as appropriate, and library references will work out too.

But for some projects, such as the "Dynamic Web Project," that's not an option. You must convert it to a Scala project after it's created as a Java project.

Fiddling with the contents of .project manually didn't get me anywhere.

The correct procedure, as found on Nabble, is:

As a general rule you should convert Java projects to Scala projects
by using the "Add Scala Nature" package explorer context menu action
unless you know what you're doing.

No comments: