i tried

export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'

and some old solutions here for java 9 same error but nothing work. please help

OS: mac. java version:

Users-MacBook-Pro:Users user$ java --version
java 11.0.2 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

open sdkManager:

Users-MacBook-Pro:~ user$ /Users/user/android/tools/bin/sdkmanager ; exit;
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

EDIT - MORE DATA: I installed java 8 as well and run this command:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version

and got:

java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

But sdkmanage still gives the same error. By the way, when close an open again the terminal, running java -version results again with:

java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

Is it OK?

UPDATE 1.4

I have change the .bash_profile file to this:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_202`

unset JAVA_OPTS

and running env give:

Users-MacBook-Pro:~ user$ env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/9t/4jx8w7_s6f5blrh1yly746z80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.gDNTyh8LPx/Render
TERM_PROGRAM_VERSION=404.1
TERM_SESSION_ID=8F5607E3-18FE-467B-B843-58F71D03F9B0
USER=user
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.jY4TgxEWu3/Listeners
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/user
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/user
LOGNAME=user
LC_CTYPE=UTF-8
_=/usr/bin/env
Users-MacBook-Pro:~ user$ 

running sdk manager still give the same error

Answer

I had the same problem and I did this:

export APP_HOME=/path/to/my/java-8
export JAVA_HOME=/path/to/my/java-8

On the other hand, if you want to keep this configuration on reboot or in other terminal, you must put these lines on ~/.bashrc file

  • 1
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions