ScalaIDE cannot find classes for not consistent package definitions
This is probably a known issue, but caused me a few hours of debugging.
Reproduction
I have traced back the issue until I got a
Probably it's the same issue, so it might help hunt it down (I'm not sure though):
My environment:
Reproduction
- Create a Scala project, bug1
- Create the following src/a/b/A.scala with the following content ( note that the package declaration is not consistent with the package folder hierarchy ):
package a
//package a.b
class A {
println("R!")
}
- Add a breakpoint to the file (e.g., on the println statement)
- Create a second scala project, bug2
- Create the following file application:
object MyApp extends App {
new a.A()
//new a.b.A()
}
- Start MyApp in debugging.
- The debugger won't stop on the breakpoint.
I have traced back the issue until I got a
ClassNotFoudException
. If you put the proper package declarations into the sources (as I commented out), it works perfectly, and the program stops on the breakpoint.Probably it's the same issue, so it might help hunt it down (I'm not sure though):
- Create a simple Scala Application in the default package:
package a;
object MyApp extends App {
println("N!")
}
- Try right-click and Run As -> Scala application.
- The result is an error message:
Error: Could not find or load main class MyApp
My environment:
Scala plugin version: 2.1.0.nightly-2_09-201205031544-a59e692 Scala compiler version: 2.9.3.v20120418-132013-8e7f44c89b Scala library version: 2.9.3.v20120418-132013-8e7f44c89b Eclipse version: 3.7.2.v201202080800
Leave a comment
on 2012-05-29 08:30 *
By Iulian Dragos
It's a known limitation, coming from the presentation compiler. No ETA for a fix.
Likewise I just spent a few hours trying to figure out what was going on.
This is a silent failure, with no indicate anywhere in the IDE that there is a problem until we start debugging.. then it can't find source code or break points. I can appreciate that this is a limitation with the compiler, however can we get some status/feedback that this is being pushed to the compiler dev group? A "warning" from the compiler (enable/disable would be OK) would be most helpful here.
This is a silent failure, with no indicate anywhere in the IDE that there is a problem until we start debugging.. then it can't find source code or break points. I can appreciate that this is a limitation with the compiler, however can we get some status/feedback that this is being pushed to the compiler dev group? A "warning" from the compiler (enable/disable would be OK) would be most helpful here.
on 2012-07-16 11:02 *
By Mirco Dotta
A ticket exactly for this was created about 1h ago ;) http://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1001154
See linked issues.