0

I've gone through the steps of installing jdk, jre, etc. on Elementary OS Hera, based on Ubuntu 18.04. I downloaded Android Studio, extracted, gave the correct permissions, etc. but when running it I get some errors

sh ./studio.sh

Start Failed
Internal error. Please refer to https://code.google.com/p/android/issues

com.intellij.ide.plugins.StartupAbortedException: UI initialization failed
    at com.intellij.idea.StartupUtil.lambda$prepareApp$3(StartupUtil.java:194)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1004)
    at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2307)
    at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:193)
    at com.intellij.ide.plugins.MainRunner.lambda$start$1(MainRunner.java:41)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.CompletionException: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
    at java.base/java.util.concurrent.CompletableFuture.andTree(CompletableFuture.java:1452)
    at java.base/java.util.concurrent.CompletableFuture.allOf(CompletableFuture.java:2337)
    at com.intellij.idea.StartupUtil.scheduleInitUi(StartupUtil.java:401)
    at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:192)
    ... 2 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
    at java.base/java.lang.Runtime.load0(Runtime.java:768)
    at java.base/java.lang.System.load(System.java:1837)
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2648)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
    at java.base/java.lang.System.loadLibrary(System.java:1873)
    at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1399)
    at java.desktop/java.awt.Toolkit$3.run(Toolkit.java:1397)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1396)
    at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1429)
    at java.desktop/java.awt.EventQueue.invokeLater(EventQueue.java:1312)
    at com.intellij.idea.StartupUtil.lambda$scheduleInitUi$9(StartupUtil.java:326)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    ... 1 more

-----
Your JRE: 11.0.11+9-Ubuntu-0ubuntu2.18.04 amd64 (Ubuntu)
/usr/lib/jvm/java-11-openjdk-amd64

Also, a UI exception occurred on an attempt to show the above message
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
    at java.desktop/java.awt.Component.<clinit>(Component.java:621)
    at com.intellij.idea.Main.showMessage(Main.java:317)
    at com.intellij.idea.Main.showMessage(Main.java:270)
    at com.intellij.ide.plugins.StartupAbortedException.logAndExit(StartupAbortedException.java:86)
    at com.intellij.ide.plugins.StartupAbortedException.processException(StartupAbortedException.java:34)
    at com.intellij.idea.StartupUtil.lambda$prepareApp$3(StartupUtil.java:194)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:986)
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1004)
    at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2307)
    at com.intellij.idea.StartupUtil.prepareApp(StartupUtil.java:193)
    at com.intellij.ide.plugins.MainRunner.lambda$start$1(MainRunner.java:41)
    at java.base/java.lang.Thread.run(Thread.java:829)

When running java -version I get this

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode)

I'm almost sure I've installed all the 64b. packages of each (jdk, jre)

I've also tried sudo update-alternatives --config java I get these options (but Android Studio won't launch on any)

Existen 2 opciones para la alternativa java (que provee /usr/bin/java).

  Selección   Ruta                                            Prioridad  Estado
------------------------------------------------------------
* 0            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      modo automático
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java      1111      modo manual
  2            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      modo manual

Thanks for any suggestion you can give me

0

Looks like the “headless” version of OpenJDK was installed. You should be able to resolve it like this:

sudo apt install openjdk-11-jdk

Once installed, be sure the correct alternative is selected with:

sudo update-alternatives --config java 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.