JavaSE-11 的运行时无效:运行时与“JavaSE-11”环境不兼容

问题描述 投票:0回答:1

我正在使用 React Native 进行编程,直到昨天我的代码在物理设备上都能正常工作,但在模拟器中却无法正常工作。一会儿我需要使用模拟器,我试图在模拟器中运行应用程序,但我怎么说,它没有建立。我尝试了各种方法,最终它仍然不起作用,但又出现另一个错误。今天我回到使用正在工作的设备,但由于变化,现在直到设备无法运行我的代码。

在vscode中,弹出2个错误:

  1.  Invalid runtime for JavaSE-11: Runtime at 'C:\Users\Interfocus\AppData\Local\jdk-11.0.2' is not compatible with the 'JavaSE-11' environment.
  2.  Invalid runtime for JavaSE-1.8: Runtime at 'C:\Program Files\Java\jdk-21' is not compatible with the 'JavaSE-1.8' environment.

并且问题中出现了很多消息,如截图所示:

我不知道这是否相关,但即使代码在物理设备上运行,每当我打开 vscode 时,都会出现以下弹出窗口:

当我在终端中运行“expo run:android”时,会显示下面的消息,但我认为这才是真正的问题,因为应用程序运行并且当它运行时,这是打开的屏幕(下图):

The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.

我只是想解决这个问题,但不知道如何解决。有人可以帮助我吗?

java react-native visual-studio-code java-11 java-18
1个回答
-1
投票

我无法评论该帖子,但我想说你找到解决这个问题的方法了吗?我尝试了很长时间但没有找到解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.