[英]java.lang.UnsupportedClassVersionError when following tutorial
I'm trying to use Play! 我正在尝试使用Play! but I always get an error when trying to run a project:
[error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
但是我在尝试运行项目时总是遇到错误:
[error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
When I do java -version
or javac -version
, it confirms I'm using Java 8 by outputting 1.8.0_45
. 当我做
java -version
或javac -version
,它确认我通过输出1.8.0_45
来使用Java 8。 I don't understand why this error happens, the docs says I NEED java 8 for the latest Play! 我不明白为什么会发生这种错误,文档说我需要java 8来获取最新的Play! version, the project has a dependency to Play!
版本,项目依赖Play! 2.4.2.
2.4.2。
I followed the documentation: installed activator, added it to the path, generated a new project form the template 'java-play-intro' but when i type activator
in my project directory, I always get the error above. 我按照文档:安装激活器,将其添加到路径,从模板'java-play-intro'生成一个新项目但是当我在项目目录中键入
activator
时,我总是得到上面的错误。 I tried to use the update-alternative
command to use java 6 and then 7 but the error is exactly the same. 我尝试使用
update-alternative
命令来使用java 6然后使用7但错误完全相同。
BUT when I use activator ui
it works fine ! 但是,当我使用
activator ui
它工作正常!
How is this possible? 这怎么可能? Am I always supposed to use the UI?
我总是应该使用UI吗?
很可能是您正在启动的脚本,使用JAVA_HOME环境变量而不是PATH上可以找到的JDK二进制文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.