Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Could not find or load main class java.se.ee" while running sdkmanager --licences

Tags:

When building my project on android studio, it asks me to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.

When I run "./sdkmanager --licenses", I have the "Could not find or load main class java.se.ee" error.

I found a lot of similar issues on stackoverflow, but non of the solutions provided worked for me.

I already tried: 1- downgrade to java 8

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

3- change sdkmanager file by adding : DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'

like image 505
Mehdi Bouih Avatar asked Jan 21 '19 10:01

Mehdi Bouih


2 Answers

I had the same issue.
And solved by following the below steps:

1) Install java 8

2) Run command in terminal

unset JAVA_OPTS

3) Then run command in terminal

./sdkmanager --licenses

like image 158
Bhaumik Surani Avatar answered Nov 06 '22 03:11

Bhaumik Surani


Well, it's been 4 months since you asked the question. You must have found the answer, but here is a way easy solution for others who are still looking for it:

JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions' 

And, Voila the issue is solved!

Why this solved the problem?

Well I don't know the exact reason but, I also don't know why we tend to add java.se.ee through "--add-modules java.se.ee", I tried removing it and error was gone! Maybe because java11 removed EE module, and it was depreciated in java10.

It was just a blind shot which worked!, If anyone knows the proper reason please comment it out!

like image 26
Khushit Shah Avatar answered Nov 06 '22 05:11

Khushit Shah