Eclipse: Java project with project-dependency on Scala project doesn't see the Scala classes at runtime
The content of the Scala container is not added to the classpath when running dependent Java project.
-----------
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/2499
Reporter gnp
Latest 2.7 series plugin on Latest 3.5 series eclipse.
Create a pure scala project and make some classes in it.
Create another project, this time pure Java and make some classes that depend on the Scala stuff. In the Java project's properties, set up a dependency on the Scala project.
At compile time the Java stuff can refer to the Scala stuff.
But at run time I get class not found problems on Scala Any class when I try to run my Java Application.
Don't think I should have to, but I did add scala nature to that Java project so at least it would get the scala runtime stuff in its classpath.
But then I still got class not found errors on my classes in the Scala project.
This multiple-project setup in my workspace is the whole way we do apps that depend on multiple underlying modules so I can't use scala if I can't get the cross-project thing working completely.
-----------
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/2499
Reporter gnp
Latest 2.7 series plugin on Latest 3.5 series eclipse.
Create a pure scala project and make some classes in it.
Create another project, this time pure Java and make some classes that depend on the Scala stuff. In the Java project's properties, set up a dependency on the Scala project.
At compile time the Java stuff can refer to the Scala stuff.
But at run time I get class not found problems on Scala Any class when I try to run my Java Application.
Don't think I should have to, but I did add scala nature to that Java project so at least it would get the scala runtime stuff in its classpath.
But then I still got class not found errors on my classes in the Scala project.
This multiple-project setup in my workspace is the whole way we do apps that depend on multiple underlying modules so I can't use scala if I can't get the cross-project thing working completely.
Leave a comment
on 2009-10-20 20:03 *
By tracImporter
Trac author: gnp
Attachment: file:Ticket-2499.zip
Eclipse workspace w/o .metadata directory (because it was too big)
Attachment: file:Ticket-2499.zip
Eclipse workspace w/o .metadata directory (because it was too big)
on 2009-10-20 20:04 *
By tracImporter
Trac author: gnp
The attached .zip contains an example where without adding the scala nature to the java project it does not work.
In my real situation adding the scala nature to the java project still doesn't let it work but in this simple example it does.
I don't know why yet.
The attached .zip contains an example where without adding the scala nature to the java project it does not work.
In my real situation adding the scala nature to the java project still doesn't let it work but in this simple example it does.
I don't know why yet.
on 2009-10-20 23:44 *
By
Does your runtime Java classpath include the Scala runtime libraries (scala-library.jar)?
on 2009-12-17 12:28 *
By
The issue appears to be that the Scala classpath container (even when explicitly exported) doesn't seem to be being added to the Java project's runtime classpath. I'm not yet clear whether this is an issue for the Scala tooling or for Eclipse more generally.
As a workaround for now you should add the Scala runtime (scala-library.jar) to your Java projects classpath.
As a workaround for now you should add the Scala runtime (scala-library.jar) to your Java projects classpath.
Updating tickets (#1000069, #1000195, #1000213, #1000223, #1000006, #1000021, #1000038, #1000048, #1000051, #1000052, #1000075, #1000103, #1000109, #1000115, #1000119, #1000156, #1000186, #1000207, #1000238, #1000262, #1000263, #380, #389, #683, #1238, #1331, #1635, #1645, #1715, #1729, #1744, #1783, #1839, #1869, #1885, #1890, #1902, #1918, #1919, #1924, #1925, #1946, #1964, #1991, #2131, #2233, #2342, #2348, #2408, #2459, #2499, #2523, #2572, #2582, #2602, #2614, #2615, #2675, #2710, #2745, #2763, #2816, #2830, #2834, #2878, #2879, #2887, #2888, #2901, #2911, #2912, #2922, #2937, #2938, #2942, #2951, #2955, #2957, #2961, #2964, #2965, #2974, #2975, #2989, #2990, #3002, #3055, #3070, #3087, #3135, #3139, #3173, #3182, #3184, #3200, #3213, #3214, #3221, #3243, #3251)
on 2012-01-23 15:18 *
By skyluc
Version set to 2.0.0-final-29
Eclipse version set to All
Assigned to changed from login to -none-
Component changed from None to Debugger
Description changed from Migrated from http://lampsv... to The content of the Scala co...
Permission type changed from None to Public
Status changed from New to Accepted
on 2014-07-11 23:58 *
By Simon Schäfer
Component changed from Debugger to -none-
Version changed from 2.0.0-final-29 to 3.0.4-211