Am working on a project, it contains both java and scala classes.
My folder structure: is
src>main>java
-> for java classes
src>main>scala
-> for scala classes
When am importing scala classes in java, eclipse saying that no type found. I already installed scala IDE in eclipse. I don't know how to fix this problem. Can anyone help me with the configuration of eclipse to work with both java and scala?
Asked
Active
Viewed 1,485 times
3

om-nom-nom
- 62,329
- 13
- 183
- 228

Dilip Kumar
- 2,504
- 2
- 17
- 33
-
How many source folders do you have in your project? – Tassos Bassoukos Mar 11 '14 at 13:26
-
Are you using a Maven plugin already? – Dave Newton Mar 11 '14 at 13:27
-
@TassosBassoukos total 3 including src/test/java. – Dilip Kumar Mar 11 '14 at 13:29
-
@DaveNewton Ya.. There is no error in build time, i configured maven to build-first-scala. But i need help on configuring eclipse. – Dilip Kumar Mar 11 '14 at 13:30
-
Does you project have a scala nature? Is src/main/scala in the build path? – jny Mar 11 '14 at 13:45
-
@jny I think No. How do i set a project to have scala nature? Yes it is in build path. Thanks – Dilip Kumar Mar 11 '14 at 13:51
-
If you have Scala IDE: Right Click on Project->Scala ->Add Scala Nature. However, if it is needed, if it is set as a Maven project – jny Mar 11 '14 at 14:01
-
@jny I haven't found Scala option in project. – Dilip Kumar Mar 11 '14 at 14:06
-
3Try Right Click on Project->Configure ->Add Scala Nature – jny Mar 11 '14 at 14:15
1 Answers
6
I solved the problem by adding scala nature to project, As told by @jny:
Right click on Project -> Configure -> Add Scala Nature

Dilip Kumar
- 2,504
- 2
- 17
- 33