Reputation:
I am just getting started with Scala since last week and I am having this problem that is driving me crazy.
I have some code that I want to migrate fully from Java to Scala (except libraries) but I have hit a block where I can't now proceed because of this mysterious error.
Let's say that I have a class that I have defined in org.domain.subdomain.MyClass
I have a class that seems to have no compilation problems (as suggested by Intellij) but when I build my project's modules, I would get the following
Class file needed by MyClass is missing
reference value subdomain of package org.domain refers to nonexisting symbol.
I am certain (or almost?) that I have got the classpath right as the projects were compiling before I started rewriting the code in Scala.
I have not been able to get it to compile with the verbose option on. I am using FSC compiler as the project compiler. Intellij does not show anything with verbose option!
What is going on here? How can I solve this?
Upvotes: 1
Views: 928
Reputation: 130
I know, the question is more than one year old, but maybe it helps someone.
I just had the same issue. One of my libraries used an newer version of org.scala-lang:scala-library than the main project. After the library update everything works fine.
Upvotes: 0
Reputation: 10667
I just had this problem, and reimporting the project in IntelliJ worked. I removed .idea directory and .iml file, then reimported the project as maven.
This is an IntelliJ issue - outside maven builds worked fine.
Upvotes: 1
Reputation: 5712
Your classpath is incomplete. The reference to org.domain.subdomain
appears in a classfile referenced by one of our sources (as indicated by the error message).
If you are rewriting Java code, you may need add more of your transitive dependencies in each module's classpath. The Scala compiler is more eager when it comes to type-checking and in some situations it needs a larger classpath.
Upvotes: 0