初始化启动层java.lang.module.FindException时发生错误:找不到模块java.se.ee

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

系统:macOS Catalina版本10.15.1。您好,我正在尝试安装Flutter。我最终遇到此错误:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found

我确实尝试将Java版本降级为Java 8,并且在系统偏好设置中说我具有版本8更新202(内部版本1.8.0_202-b08),但是当我运行命令时java -version它说:

java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)  
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing). 

复制步骤:

  1. flutter doctor

    输出:

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.1 19B88,
    locale en-IN)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)

   ✗ Android license status unknown.

Try re-installing or updating your Android SDK Manager.

See https://developer.android.com/studio/#downloads or visit
https://flutter.dev/setup/#android-setup for detailed instructions.

[!] Xcode - develop for iOS and macOS (Xcode 10.3)

 ✗ CocoaPods installed but not working.

You appear to have CocoaPods installed but it is not working.

This can happen if the version of Ruby that CocoaPods was installed with
is different from the one being used to invoke it.

This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.

To re-install CocoaPods, run:
sudo gem install cocoapods
[✓] Android Studio (version 3.4)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

  1. flutter doctor --android-licenses

    输出:

A newer version of the Android SDK is required. To update, run:
/Users/bsikriwal/Library/Android/sdk/tools/bin/sdkmanager --update

3. /Users/bsikriwal/Library/Android/sdk/tools/bin/sdkmanager --update

输出:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found

有帮助吗?谢谢。

java flutter
1个回答
1
投票

OpenJDK 10被OpenJDK 11取代,后者根本没有实现java.se.ee。这意味着添加--add-modules java.se.ee的技巧不再起作用。这也意味着,如果正确配置了更新,则下次更新时,OpenJDK 10将自动从系统中删除并替换为OpenJDK 11。

[要解决此问题,可以通过将sdkmanager中的JAVA_HOME设置为Java 8安装来修改sdkmanager以使用Java 8。默认情况下,它仍然位于~/Android/Sdk/tools/bin/sdkmanager.

# Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options $
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions'
@rem Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options to this script.
set JAVA_HOME="C:\ProgramData\scoop\apps\android-studio\current\jre"
set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0\.."

这样,您可以在使用sdkmanager的同时继续在系统上使用健全和维护的Java版本。

# Java
export JAVA_HOME=/usr/lib/jvm/default-java
热门问题
推荐问题
最新问题