运行我编译的JAR:“Unsupported major.minor version 52.0” [英] Running a JAR I compiled: "Unsupported major.minor version 52.0"

查看:746
本文介绍了运行我编译的JAR:“Unsupported major.minor version 52.0”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚从旧硬盘中恢复了一些程序,所以我尝试编译并运行它,并在命令提示符下出现此错误:

I just recently recovered some programs from my old hard drive, so I tried compiling one and running it, and I get this error in command prompt:

不支持的专业.minor版本52.0

Unsupported major.minor version 52.0

我用Java 8编译了程序,我用Java 8运行它。我唯一能想到的是我使用Java 7的事实在我的旧电脑上的程序。此外,我在这台新电脑上使用Windows XP,而我在旧电脑上使用Windows 7.

I compiled the program with Java 8, and I ran it with Java 8. The only thing I can think of is the fact that I used Java 7 with the program on my old computer. Also, I'm using Windows XP on this new computer, while I used Windows 7 on the old computer.

我使用的是两个库,但我不认为这是问题,因为该程序在NetBeans中运行正常。

I am using two libraries, but I don't think that is the issue since the program ran fine in NetBeans.

有什么问题是什么?

推荐答案

根据您对原型答案的评论,我的猜测是java 7位于您的一个Windows目录中,如C:\ Windows \ System32,该目录位于您的JAVA_HOME目录之前你的道路。尝试在CMD上键入where java。如果它位于多个目录中,请查看PATH变量中的哪一个,并查看该目录中的java版本。

Based on your comment to archetype's answer, my guess is that java 7 is in one of your windows directories, like C:\Windows\System32 and that directory is before your JAVA_HOME directory in your path. Try typing 'where java' on the CMD. If it's in more than one directory, see which one comes first in your PATH variable and look at the version of java in that directory.

这篇关于运行我编译的JAR:“Unsupported major.minor version 52.0”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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