0

I got a new Laptop and I recently installed Android Studio. I've managed to run it on my first few tries, but it suddenly won't open afterwards. Perhaps it might be because I've been setting up and installing/uninstalling other apps for the laptop, and the IDE's components might get mixed along the way. I really don't know, i'm new at coding :( . I even tried installing the new Java as an attempt to solve this, but it didn't work considering that I didn't even installed Java in the first place back when it's still working.

I tried researching along the way, anything related "Can't open, Android Studio" I tried doing the thing where you open it and close it and in Task Manager. But it doesn't even show in the task manager lol , i got nothing to close.

and i did the thing that majority of the people said "add the system variable JAVA HOME and JDK HOME to correct the JAVA installation location" ...... It did show the error, but I don't know how to fix it. (SEE ATTACHED CODE FROM CMD PROMPT)

Can someone help me and give me an instruction to fix this in a way that a noob in coding, like me, would understand :'(

 Microsoft Windows [Version 10.0.22000.318]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Zethra>echo %JAVA_HOME%
C:\Program Files\Java\jre1.8.0_333

C:\Users\Zethra>echo %JDK_HOME%
C:\Program Files\Java\jre1.8.0_333

C:\Users\Zethra>cd \Program Files\Android\Android Studio\bin

C:\Program Files\Android\Android Studio\bin>studio.bat
Error occurred during initialization of VM
java.lang.UnsupportedClassVersionError: com/intellij/util/lang/PathClassLoader has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at java.lang.SystemClassLoaderAction.run(Unknown Source)
        at java.lang.SystemClassLoaderAction.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.lang.ClassLoader.initSystemClassLoader(Unknown Source)
        at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)


C:\Program Files\Android\Android Studio\bin>
Zethra
  • 1

1 Answers1

0

Accordings to "java.lang.UnsupportedClassVersionError: com/intellij/util/lang/PathClassLoader has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52" I think that you are using an obsolete version of Java (Java SE8). Why don't you try this: https://www.oracle.com/java/technologies/downloads/#java18

r-q
  • 11
  • 4
  • I've already installed the newest java, as an attempt to fix the problem. But it didn't work as well.. although, I did installed it here in this website https://www.java.com/en/ is this any different from what you sent ? – Zethra Jul 09 '22 at 09:14
  • The thing is that, as your question log shows, C:\Users\Zethra>echo %JAVA_HOME% C:\Program Files\Java\jre1.8.0_333 C:\Users\Zethra>echo %JDK_HOME% C:\Program Files\Java\jre1.8.0_333 – r-q Jul 09 '22 at 09:22
  • They are linked to old versions of Java, so you might need to change those environmental variables – r-q Jul 09 '22 at 09:23
  • Anyway, I suggest that you install it from the Oracle site, because they are the newest development build – r-q Jul 09 '22 at 09:25
  • Like install the java in the website you sent, and link those variables at the downloaded java? is this what you're trying to say? okay ill try downloading it in the oracle site – Zethra Jul 09 '22 at 09:28
  • it popped out two error prompts with long ass codes on it, but i think these are the main sentences on the 1st prompt: ""Internal error. Please refer to https://code.google.com/p/android/issues "com.intellij.ide.plugins.StartupAbortedException: UI initialization failed"" ""Caused by: java.util.concurrent.CompletionException: java.lang.IllegalAccessError: class com.intellij.idea.StartupUtil"" ""Caused by: java.lang.IllegalAccessError: class com.intellij.idea.StartupUtil (in unnamed module @0x63bb211f"" – Zethra Jul 09 '22 at 09:41
  • reinstalling didnt work either. Unfortunately i cant paste the whole error prompt code here :( i just uploaded the whole code in a txt file.. here's the link... https://drive.google.com/file/d/1or2ksAa-iHym9e3q8MoKaikdaYX7k85q/view?usp=sharing – Zethra Jul 09 '22 at 09:57
  • I linked the new variables to the new java too. but still wont launch :( – Zethra Jul 09 '22 at 09:58
  • What about the PATH variable, anyway? Did you delete links related to the old version in it? Make sure you add "C:\Program Files\Java\jdk-18\bin" or your own one in the PATH. Also, feel free to remove the old version because two versions of Java can co-exist in the same time. – r-q Jul 10 '22 at 11:38