Java installing

I’ve been trying to run android studio in replit but when I try running it I get this very long error (warning very long)

java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
    at java.desktop/java.awt.Component.<clinit>(Component.java:628)
    at com.intellij.platform.ide.bootstrap.StartupErrorReporter.showMessage(StartupErrorReporter.java:111)
    at com.intellij.platform.ide.bootstrap.StartupErrorReporter.showMessage(StartupErrorReporter.java:61)
    at com.intellij.platform.ide.bootstrap.StartupUtil.lockSystemDirs(main.kt:652)
    at com.intellij.platform.ide.bootstrap.StartupUtil.access$lockSystemDirs(main.kt:1)
    at com.intellij.platform.ide.bootstrap.StartupUtil$lockSystemDirs$1.invokeSuspend(main.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /home/runner/Downloads/android-studio/jbr/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory [in thread "DefaultDispatcher-worker-9"]
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
    at java.base/java.lang.Runtime.load0(Runtime.java:755)
    at java.base/java.lang.System.load(System.java:1957)
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
    at java.base/java.lang.System.loadLibrary(System.java:1993)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1388)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1386)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1385)
    at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1428)
    at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1397)
    at com.intellij.util.ui.StartupUiUtil.isWaylandToolkit(StartupUiUtil.kt:189)
    at com.intellij.platform.ide.bootstrap.SplashManagerKt$showSplashIfNeeded$newJob$1.invokeSuspend(SplashManager.kt:92)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    ... 4 more
CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true

Start Failed
Internal error. Please refer to https://issuetracker.google.com/issues/new?component=192708

kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=UndispatchedCoroutine{Cancelling}@71a9afaa
Caused by: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invokeSuspend(ui.kt:159)
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
    at com.intellij.platform.ide.bootstrap.UiKt$initAwtToolkit$2.invoke(ui.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
    at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
    at com.intellij.platform.ide.bootstrap.UiKt.initAwtToolkit(ui.kt:158)
    at com.intellij.platform.ide.bootstrap.UiKt.access$initAwtToolkit(ui.kt:1)
    at com.intellij.platform.ide.bootstrap.UiKt$scheduleInitAwtToolkit$task$1$1.invokeSuspend(ui.kt:123)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /home/runner/Downloads/android-studio/jbr/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory [in thread "DefaultDispatcher-worker-6"]
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
    at java.base/java.lang.Runtime.load0(Runtime.java:755)
    at java.base/java.lang.System.load(System.java:1957)
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
    at java.base/java.lang.System.loadLibrary(System.java:1993)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1388)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1386)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1385)
    at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1428)
    at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1397)
    at com.intellij.util.ui.StartupUiUtil.isWaylandToolkit(StartupUiUtil.kt:189)
    at com.intellij.platform.ide.bootstrap.SplashManagerKt$showSplashIfNeeded$newJob$1.invokeSuspend(SplashManager.kt:92)
    ... 6 more

-----
Your JRE: 17.0.10+0-17.0.10b1087.21-11572160 amd64 (JetBrains s.r.o.)
/home/runner/Downloads/android-studio/jbr

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:628)
    at com.intellij.platform.ide.bootstrap.StartupErrorReporter.showMessage(StartupErrorReporter.java:111)
    at com.intellij.platform.ide.bootstrap.StartupErrorReporter.showMessage(StartupErrorReporter.java:61)
    at com.intellij.platform.ide.bootstrap.StartupUtil.lockSystemDirs(main.kt:652)
    at com.intellij.platform.ide.bootstrap.StartupUtil.access$lockSystemDirs(main.kt:1)
    at com.intellij.platform.ide.bootstrap.StartupUtil$lockSystemDirs$1.invokeSuspend(main.kt)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: /home/runner/Downloads/android-studio/jbr/lib/libawt_xawt.so: libXext.so.6: cannot open shared object file: No such file or directory [in thread "DefaultDispatcher-worker-6"]
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2394)
    at java.base/java.lang.Runtime.load0(Runtime.java:755)
    at java.base/java.lang.System.load(System.java:1957)
    at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
    at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
    at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:315)
    at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:285)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2403)
    at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
    at java.base/java.lang.System.loadLibrary(System.java:1993)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1388)
    at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:1386)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.desktop/java.awt.Toolkit.loadLibraries(Toolkit.java:1385)
    at java.desktop/java.awt.Toolkit.initStatic(Toolkit.java:1428)
    at java.desktop/java.awt.Toolkit.<clinit>(Toolkit.java:1397)
    at com.intellij.util.ui.StartupUiUtil.isWaylandToolkit(StartupUiUtil.kt:189)
    at com.intellij.platform.ide.bootstrap.SplashManagerKt$showSplashIfNeeded$newJob$1.invokeSuspend(SplashManager.kt:92)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    ... 4 more

also I think I need java because it keeps saying java

Hi @crstegs !
Android Studio cannot be run in Replit, nor can mobile development code.
Please install the actual Android Studio to do this instead.
Hope this helps!

2 Likes