英文:
Error when running Java file through Intellij terminal
问题
In Intellij IDEA,在终端运行Java文件或运行JAR构件时,我遇到以下错误:
我的计算机上安装了最新版本的JDK和运行时环境,并且只安装了一个运行时环境。此外,我并没有问题实际编译程序,只有"$java Program"命令有问题。
英文:
In Intellij IDEA, when I run a java file in the terminal or run a jar artifact, I get this error:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论