Ubuntu getting Module java.se.ee after set on path

2020-02-07 05:48发布

问题:

as I get java.lang.module.FindException: Module java.se.ee not found error when I try to update android sdk I set this paths on /etc/environment:

JAVA_HOME="/usr/lib/jvm/java-12-oracle"
export JAVA_HOME
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
export SDKMANAGER_OPTS='--add-modules java.se.ee'

and after run this command:

source /etc/environment

I dont get any message on terminal, now this command:

sudo /usr/lib/android-sdk/tools/bin/sdkmanager --update

show me this error:

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

UPADATE:

i install OpenJDK

$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1-b01)
OpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode)

and after set as default that i get error too

Error: Could not find or load main class java.se.ee

restarting ubuntu - terminal and source /etc/environment command couldnt resolve my problem

DEFAULT_JVM_OPTS on sdkmanager file content:

#DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME"'

回答1:

I faced the same issue on Ubuntu.

And just solved by running the below command in the terminal

unset JAVA_OPTS



标签: java ubuntu