简体   繁体   English

在ubuntu 15中安装Android Studio时,运行studio.sh,但报告“无法打开共享对象文件”

[英]when installing Android Studio in ubuntu 15,run studio.sh,but it report “cannot open shared object file”

I install an Android develop environment in ubuntu15,after installing JDK,and SDK tools,run studio.sh,it reports some error info: 我在ubuntu15中安装了Android开发环境,安装了JDK和SDK工具后,运行studio.sh,它报告一些错误信息:

Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=350m;    support was removed in 8.0

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

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.ide.Bootstrap.main(Bootstrap.java:39)
at com.intellij.idea.Main.main(Main.java:92)

Caused by: java.lang.UnsatisfiedLinkError: /home/xhk/java/jdk1.8.0_60/jre/lib/i386/libawt_xawt.so: libXtst.so.6: 
cannot open shared object file: No such file or directory

at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1821)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1938)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1842)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.Toolkit$3.run(Toolkit.java:1636)
at java.awt.Toolkit$3.run(Toolkit.java:1634)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
at java.awt.Toolkit.<clinit>(Toolkit.java:1668)
at java.awt.Cursor.<clinit>(Cursor.java:195)
at javax.swing.text.html.HTMLEditorKit.<clinit>(HTMLEditorKit.java:623)
at com.intellij.util.ui.UIUtil.<clinit>(UIUtil.java:96)
at com.intellij.ide.plugins.PluginManager.start(PluginManager.java:72)
... 6 more


Also, an UI exception occurred on attempt to show above message:
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at java.awt.Component.<clinit>(Component.java:593)
at com.intellij.idea.Main.showMessage(Main.java:248)
at com.intellij.idea.Main.showMessage(Main.java:234)
at com.intellij.idea.Main.showMessage(Main.java:224)
at com.intellij.idea.Main.main(Main.java:95)

but libawt_xawt.so, libXtst.so.6 have existed,PATH has been set 但是libawt_xawt.so,libXtst.so.6已经存在,PATH已设置

$ locate libawt_xawt.so
/home/xhk/java/jdk1.8.0_60/jre/lib/i386/libawt_xawt.so
$ locate libXtst.so.6
/usr/lib/x86_64-linux-gnu/libXtst.so.6
/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0
$ echo$PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/xhk/java/jdk1.8.0_60/bin:/home/xhk/java/jdk1.8.0_60/jre/bin:/home/xhk/android/android-sdk-linux:/home/xhk/android/android-sdk-linux/tools:/home/xhk/android/android-sdk-linux/platform-tools

How can i fix it? 我该如何解决? o.0 o.0

You seem to have installed the 32 bit version of the java SDK as indicated by this line: 您似乎已经安装了32位版本的Java SDK,如以下行所示:

/home/xhk/java/jdk1.8.0_60/jre/lib/i386/libawt_xawt.so

But your system is a 64 bit system as indicated by these lines 但是您的系统是如以下行所示的64位系统

/usr/lib/x86_64-linux-gnu/libXtst.so.6
/usr/lib/x86_64-linux-gnu/libXtst.so.6.1.0

There are two solutions. 有两种解决方案。 The first is to install the 64 bit version of the java jdk. 首先是安装Java jdk的64位版本。 The second is to install the 32 bit version of the libXtst 第二种是安装32位版本的libXtst

sudo apt-get install libxtst6:i386

I would prefer the first option 我希望第一个选择

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM