[英]Can scala code compiled with JDK 7 run on JVM 8?
I have a project using scala for several microservices. 我有一个使用scala的几个微服务项目。 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?
我们计划迁移到Java 8,但是由于gradle的Scala插件的局限性以及scala和Java 8之间的兼容性,这些微服务仍将在JDK 7上编译。我的问题是,它们将在不做任何修改的情况下在JVM 8上运行或特定配置?
Scala 2.11 which is just released is not yet compatible with Java 8 bytecode. 刚刚发布的Scala 2.11尚不兼容Java 8字节码。 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.
但是JVM 8是向后兼容的,因此,只要您仍在JDK 7上编译Scala代码,并将其放在JVM 8中,一切都将正常工作。
Might not be applicable to you, but latest Scala only works with JDK 6+, so nothing lower than JDK 6. 可能不适用于您,但是最新的Scala仅适用于JDK 6+,因此没有低于JDK 6的版本。
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.
用Java 6或5编译的代码也一样。我不确定较早的版本,但仍希望它们能工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.