安装 Android Studio 时出错?

安装 Android Studio 时出错?

我正在启动 Android Studio(这是在解压从Android Studio 网站) 通过./studio.sh目录调用android-studio/bin

我收到以下错误:

Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$AppClassLoader
WARN: Unknown class loader: jdk.internal.loader.ClassLoaders$PlatformClassLoader

Start Failed: Internal Error. Please report to https://code.google.com/p/android/issues

java.lang.AssertionError: Internal error: ClassLoader implementation has been altered
at com.intellij.util.lang.UrlClassLoader.isRegisteredAsParallelCapable(UrlClassLoader.java:72)
at com.intellij.util.lang.UrlClassLoader.<init>(UrlClassLoader.java:179)
at com.intellij.util.lang.UrlClassLoader$Builder.get(UrlClassLoader.java:151)
at com.intellij.ide.BootstrapClassLoaderUtil.initClassLoader(BootstrapClassLoaderUtil.java:69)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:32)
at com.intellij.idea.Main.main(Main.java:119)


Also, an UI exception occurred on attempt to show above message:
java.lang.ExceptionInInitializerError
at com.intellij.util.concurrency.AtomicFieldUpdater.<clinit>(AtomicFieldUpdater.java:41)
at com.intellij.util.containers.LockFreeCopyOnWriteArrayList.<clinit>(LockFreeCopyOnWriteArrayList.java:54)
at com.intellij.util.containers.ContainerUtil.createConcurrentList(ContainerUtil.java:2611)
at com.intellij.util.containers.ContainerUtil.createLockFreeCopyOnWriteList(ContainerUtil.java:2465)
at com.intellij.openapi.util.registry.RegistryValue.<init>(RegistryValue.java:36)
at com.intellij.openapi.util.registry.Registry.get(Registry.java:48)
at com.intellij.openapi.util.registry.Registry.is(Registry.java:55)
at com.intellij.util.ui.UIUtil.blockATKWrapper(UIUtil.java:112)
at com.intellij.util.ui.UIUtil.<clinit>(UIUtil.java:99)
at com.intellij.idea.Main.showMessage(Main.java:368)
at com.intellij.idea.Main.showMessage(Main.java:341)
at com.intellij.idea.Main.showMessage(Main.java:320)
at com.intellij.idea.Main.main(Main.java:122)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private jdk.internal.reflect.ConstructorAccessor java.lang.reflect.Constructor.acquireConstructorAccessor() accessible: module java.base does not "opens java.lang.reflect" to unnamed module @7c29daf3
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:335)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:278)
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:196)
at java.base/java.lang.reflect.Method.setAccessible(Method.java:190)
at com.intellij.util.ReflectionUtil.findMethod(ReflectionUtil.java:265)
at com.intellij.util.ReflectionUtil.getDeclaredMethod(ReflectionUtil.java:279)
at com.intellij.util.ReflectionUtil.<clinit>(ReflectionUtil.java:422)
... 13 more

我正在使用 Oracle 的 Java 版本 9

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+162)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+162, mixed mode)

编辑:由于我使用的是 64 位版本的 Ubuntu,因此我还使用以下命令安装了一些 32 位库:

$ sudo apt-get 安装 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1

答案1

这是 JDK 9 的一个错误(更像是一个弃用的功能)。如果不必使用 JDK 9,我建议改用 JDK 8。

查看Digital Ocean 逐步指导您在 ubuntu 中设置 JDK。

相关内容