Devs love ZenUML
Devs love ZenUML

Reputation: 11882

Can scala code compiled with JDK 7 run on JVM 8?

I have a project using scala for several microservices. We are planning to move to Java 8, but due to the limitation of gradle's Scala plugin and the compatibility between scala and Java 8, those micro services will still be compiled on JDK 7. My question is will they run on JVM 8 without any modification or specific configurtion?

Upvotes: 1

Views: 2434

Answers (2)

suriyanto
suriyanto

Reputation: 1095

Scala 2.11 which is just released is not yet compatible with Java 8 bytecode. However JVM 8 is backward compatible, so as long as you are still compiling your Scala code on JDK 7 and you just drop it in JVM 8, everything will be working fine.

Might not be applicable to you, but latest Scala only works with JDK 6+, so nothing lower than JDK 6.

Upvotes: 1

Alexey Romanov
Alexey Romanov

Reputation: 170805

Yes, they will. So will those compiled on Java 6 or 5. I am not sure about earlier versions, but would still expect them to work.

Upvotes: 0

Related Questions