英文:
Error when I run flutter doctor --android-licenses
问题
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I tried also JDK 11 but it doesn't work.
How do I fix?
英文:
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I tried also JDK 11 but it doesn't works.
How do I fix?
答案1
得分: 0
这个错误告诉我们,我们的类是在比我们尝试运行它的Java版本更高的版本中编译的。更具体地说,在这种情况下,我们使用Java 11编译了我们的类,然后尝试在Java 8上运行它。
我们有两种方法可以解决这个错误:要么为较早的Java版本编译我们的代码,要么在较新的Java版本上运行我们的代码。
我认为这个网站可能会对你有所帮助 https://www.baeldung.com/java-lang-unsupportedclassversion
英文:
This error is telling us that our class was compiled at a higher version of Java than the version with which we tried to run it. More specifically, in this case we compiled our class with Java 11 and tried to run it with Java 8.
we have two ways we can resolve this error: compile our code for an earlier version of Java, or run our code on a newer Java version.
I think this website might help you https://www.baeldung.com/java-lang-unsupportedclassversion
答案2
得分: 0
-
我也遇到了这个问题
-
重新启动
-
修改 java_home 为 java11
运行 flutter doctor --android-licenses
成功;
> 我的想法
运行 flutter doctor -v
发现在 Android Studio 中的 android jre,
切换 Java 版本没有效果
已经提交了这个错误,然后考虑首先卸载 Android Studio
然后重新启动切换到 java11 的 javahome 路径
再次运行 'flutter doctor --android-licenses'
成功!
开心(不排除是我的操作问题,这是我的解决方案,希望能帮助,欢迎指正,谢谢!)
无法找到 Android 下载管理器,可以检查最新版本
工具
英文:
I also met this problem
-
del
Two folders and delete backup here
enter image description here -
restart
-
Modify the java_home java11
flutter doctor --android-licenses
SUCCESS;
> my idea
flutter doctor -v
Found that he is the android jre in the studio,
Switch the Java version has no effect
Has been submitted to the error in this, and then think of first take the Android's studio
After the restart switch to java11 javahome path
Performed again 'flutter doctor --android-licenses'
SUCCESS!
happy(Do not rule out is my operational problems, this is my solution, hope to bring help, welcome to correct me, thank you!)
Can't find the android download manager can check the latest
tools
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论