如何设置 Play Framework 2.0 的 javac 编译版本以防止出现“Unsupported major.minor version"? [英] How can I set the javac compile version for Play Framework 2.0 to prevent "Unsupported major.minor version"?

查看:35
本文介绍了如何设置 Play Framework 2.0 的 javac 编译版本以防止出现“Unsupported major.minor version"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

A module I am using must have been compiled with Java 1.7, and I only have 1.6.

If I want to for the module to be compiled for a specific version like 1.6, how can I set that in Play! Framework 2.0 so that I can prevent the "Unsupported major.minor version" errors.

In Play! 1.x you could set "java.version=1.6" in the application.conf.

I assume that in Play! 2.x it probably needs to be set somewhere for sbt - but where/how?

解决方案

Adding

javacOptions ++= Seq("-source", "1.6", "-target", "1.6")

to the build.sbt file worked for me (to be transparent, in my case it was 1.7 to build with JDK 8).

这篇关于如何设置 Play Framework 2.0 的 javac 编译版本以防止出现“Unsupported major.minor version"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆