I am new to Scala. However, I a created a medium size program with Scala 2.9.0. Now I want to use an open source library which is only available for Scala 2.7.7.
Is it possible to use this 2.7.7 library in my Scala 2.9.0 program? How can I do it? I had already a look at sbt but did not really succeed. Has someone a hello world example for this?
It should be possible in principle using a custom classloader for the 2.7.7 jar and custom wrappers. But practically, since the library is open source, it's very likely that it would be less work to recompile it with 2.9 and make those changes which are required. (There usually aren't many.)
Typesafe has an early preview of a migration manager (http://typesafe.com/technology/migration-manager) which promises to report on and resolve binary incompatibilities. Apparently the early preview only report on incompatibilities, but it might be worth a shot.
The best approach would be to either use a maintained library or to update the code.
If you take the second option, compile the code with the flags -deprecation
and -Xmigration
.
This tells you what you need to change between versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With