在使用Intellij终端运行Java文件时出错。

huangapple go评论60阅读模式
英文:

Error when running Java file through Intellij terminal

问题

In Intellij IDEA,在终端运行Java文件或运行JAR构件时,我遇到以下错误:

在使用Intellij终端运行Java文件时出错。

我的计算机上安装了最新版本的JDK和运行时环境,并且只安装了一个运行时环境。此外,我并没有问题实际编译程序,只有"$java Program"命令有问题。

英文:

In Intellij IDEA, when I run a java file in the terminal or run a jar artifact, I get this error:

在使用Intellij终端运行Java文件时出错。

I have an up to date jdk and runtime enviroment installed on my computer, and I only have one runtime environment installed. Also, I do not have an issue with the actual compilation of the program, just the
"$java Program" command.

答案1

得分: 0

错误信息很明确:您使用比您用于执行它的Java版本更新的Java源代码进行了编译。

因此,您只安装了一个Java版本的假设可能是不正确的。您是否知道IDE本身附带了Java运行时?

下次请将文本作为文本发布,而不是链接到图像。

英文:

The error message is clear: You compiled the Java source with an newer Java version than your are using to execute it.

So your assumption that you have only one Java version installed cannot be correct. Are you aware that the IDE itself comes with a Java runtime?

Next time please post text as text, not a link to an image.

huangapple
  • 本文由 发表于 2020年8月1日 17:22:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/63203641.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定