Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Scala 2.8.1 and SBT work ok with JDK 7?

Tags:

java

scala

sbt

Aren't Scala 2.8.1 compiler, applications built with it, Sbt 1.7.4/1.7.5RC and Scala 2.7.7 (needed to run Sbt) known to have any problems running with a current alpha of OpenJDK 7?

like image 575
Ivan Avatar asked Jan 11 '11 23:01

Ivan


People also ask

What JDK does Scala use?

JDK 8, 11, and 17 are all reasonable choices both for compiling and running Scala code. Since the JVM is normally backwards compatible, it is usually safe to use a newer JVM for running your code than the one it was compiled on, especially if you are not using JVM features designated “experimental” or “unsafe”.

Is Scala compatible with Java?

For example, Scala uses type erasure to be compatible with Java. Type erasure also allows Scala to be easily integrated with dynamically typed languages for the JVM. Some Scala features (such as traits) don't directly map to Java, and in those cases you have to use workarounds (more about this in section 11.3).

Does Scala need JDK?

Note that you do need a JDK for development (that is, to compile you Scala code into Java bytecode).

Why is Scala compatible with Java?

Since Scala was built for the JVM platform, its source code is designed to be compiled into Java bytecode so that the code generated can run efficiently on the JVM.


2 Answers

There are issues, mostly with swing because they took some formerly non-generic types and gave them type parameters. Scala is not big on this sort of thing.

I ported trunk to a recent version of openjdk here: https://github.com/scala/scala/tree/openjdk

There was one bit I had to disable until I get a compiler fix, which is documented here: https://lampsvn.epfl.ch/trac/scala/ticket/3634

like image 65
psp Avatar answered Oct 13 '22 07:10

psp


People frequently post benchmark results for Scala using OpenJDK 7 to the mailing list, and backwards compatibility is always a huge, overpowering concern with Java, so I think everything works fine.

like image 20
Erik Engbrecht Avatar answered Oct 13 '22 05:10

Erik Engbrecht