本文介绍了共享库 - 64位Ubuntu上的Java 32位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行名为jMRUI的MRS光谱分析的生物信息学程序。该程序的可执行文件是带有以下代码的.sh:

I am trying to run a Bioinformatics program for MRS spectrosopy analysis called "jMRUI". The executable for this program is a .sh with the following code:

    java -Xss2m -mx1200m -Djava.library.path=lib -jar lib/mrui.jar

我有 JDK 1.8安装在我的电脑上/ usr / lib /目录下jvm /.

I have both the 64bit and 32bit JDK 1.8 installed on my PC at the directory /usr/lib/jvm/.

    64bit found at: /usr/lib/jvm/jdk1.8.0_x64/bin/java
    32bit found at: /usr/lib/jvm/jdk1.8.0_x86/bin/java

pointer 符号链接指向/ etc / alternatives / java,如果当前选择64位版本,则指向/usr/lib/jvm/jdk1.8.0_x64/bin/java或/usr/lib/jvm/jdk1.8.0_x86/bin/java如果当前选择了32位。所有三个的权限都在下面。

The pointer symbolic link at /usr/bin/java points to /etc/alternatives/java which points to /usr/lib/jvm/jdk1.8.0_x64/bin/java if the 64bit version is currently selected or /usr/lib/jvm/jdk1.8.0_x86/bin/java if 32bit is currently selected. Permissions of all three are below.

    lrwxrwxrwx 1 root root 22 Jul  2 17:34 /usr/bin/java -> /etc/alternatives/java
    lrwxrwxrwx 1 root root 34 Jul  2 18:29 /etc/alternatives/java -> /usr/lib/jvm/jdk1.8.0_x(VER#)/bin/java
    -rwxr-xr-x 1 lillian lillian 5730 Mar 18 02:58 /usr/lib/jvm/jdk1.8.0_x64/bin/java
    -rwxr-xr-x 1 lillian lillian 5730 Mar 18 02:58 /usr/lib/jvm/jdk1.8.0_x86/bin/java

我可以使用运行以下代码的bash脚本在java版本之间切换:
从32位java回到64位java:

I can switch between java versions simply with a bash script that runs the following code:From 32bit java back to 64bit java:

    #!/bin/sh
    #the next 3 commands are only run initially to install the link alternative
    #associations. I give everything the same priority of 1.
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_x64/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_x64/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_x64/bin/javaws" 1

    echo 1 | sudo update-alternatives --config java
    echo 1 | sudo update-alternatives --config javac
    echo 1 | sudo update-alternatives --config javaws

从64位到32位:

    #!/bin/sh
    #the next 3 commands are only run initially to install the link alternative
    #associations. I give everything the same priority of 1.
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_x86/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_x86/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_x86/bin/javaws" 1

    echo 1 | sudo update-alternatives --config java
    echo 1 | sudo update-alternatives --config javac
    echo 1 | sudo update-alternatives --config javaws

告诉我也要安装以下内容适用于32位java的软件包。这是所有建议的测试命令的输出。

This post told me to also install the following packages for 32bit java. Here is output from all of the suggested test commands.


  1. readelf -l / usr / bin / java

  1. readelf -l /usr/bin/java

Elf file type is EXEC (Executable file)
Entry point 0x8048420
There are 8 program headers, starting at offset 52
Program Headers:
    Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
    PHDR           0x000034 0x08048034 0x08048034 0x00100 0x00100 R E 0x4
    INTERP         0x000134 0x08048134 0x08048134 0x00013 0x00013 R   0x1
       [Requesting program interpreter: /lib/ld-linux.so.2]
    LOAD           0x000000 0x08048000 0x08048000 0x00710 0x00710 R E 0x1000
    LOAD           0x000710 0x08049710 0x08049710 0x00144 0x0014c RW  0x1000
    DYNAMIC        0x00072c 0x0804972c 0x0804972c 0x00108 0x00108 RW  0x4
    NOTE           0x000148 0x08048148 0x08048148 0x00044 0x00044 R   0x4
    GNU_EH_FRAME   0x00069c 0x0804869c 0x0804869c 0x0001c 0x0001c R   0x4
    GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4

Section to Segment mapping:
Segment Sections...
    00
    01     .interp
    02     .interp .note.ABI-tag .note.gnu.build-id .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_d .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame
    03     .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .data .bss
    04     .dynamic
    05     .note.ABI-tag .note.gnu.build-id
    06     .eh_frame_hdr
    07


  • ls -l /lib/ld-linux.so.2

  • ls -l /lib/ld-linux.so.2

    lrwxrwxrwx 1 root root 25 Apr 12 05:44 /lib/ld-linux.so.2 -> i386-linux-gnu/ld-2.19.so
    


  • ldd java

  • ldd java

    linux-gate.so.1 =>  (0xf775c000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7728000)
    libjli.so => not found
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7722000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7573000)
    /lib/ld-linux.so.2 (0xf775d000)
    


  • 由于找不到libjli.so,我试图在任何与i386有关的推荐软件包中使用apt-get。没有更改libjli.so的未找到状态到找到。

  • Since libjli.so was not found, I have tried to apt-get at pretty much any recommended package involved with i386. None have changed the "not found" status of libjli.so to found.

    当/ usr / bin / java指向64位java,jMRUI启动,但是当我尝试上传.SDAT文件时崩溃(基本上当我打开任何文件时)。当我尝试打开文件时,我收到此错误消息,然后它会挂起,直到您终止该过程:

    When /usr/bin/java points to the 64bit java, jMRUI launches, but crashes when I try to upload an .SDAT file (basically when I open any file). When I try to open a file, I get this error message and then it hangs until you kill the process:

        Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library
        /home/lillian/Downloads/jMRUI-4.0/lib/libfftw.so which might have disabled stack
        guard. The VM will try to fix the stack guard now.
        It's highly recommended that you fix the library with 'execstack -c <libfile>',
        or link it with '-z noexecstack'.
        Exception in thread "Thread-1" java.lang.UnsatisfiedLinkError:
        /home/lillian/Downloads/jMRUI-4.0/lib/libfftw.so: /home/lillian/Downloads/jMRUI-
        4.0/lib/libfftw.so:
        wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
            at java.lang.Runtime.loadLibrary0(Runtime.java:870)
            at java.lang.System.loadLibrary(System.java:1119)
            at fft.Fft.<clinit>(Unknown Source)
            at mrui.data.FID.constructSpectrum(Unknown Source)
            at mrui.data.Data.constructSpectrum(Unknown Source)
            at mrui.data.Data.constructSpectrum(Unknown Source)
            at mrui.data.Data.addSignal(Unknown Source)
            at mrui.conversion.philips.FilePhil.loadData(Unknown Source)
            at mrui.plugin.conversion.ConversionManager.loadFile(Unknown Source)
            at mrui.plugin.conversion.FileManagementRead.loadInBackground(Unknown Source)
            at mrui.plugin.conversion.FileManagementRead.run(Unknown Source)
            at java.lang.Thread.run(Thread.java:745)
    

    当/ usr / bin / java指向32位java时,jMRUI根本不启动,我收到此错误消息:

    When /usr/bin/java points to the 32bit java, jMRUI does not launch at all, and I get this error message:

        ./jmrui.sh
        Jul 02, 2014 6:56:04 PM mrui.Launcher main
        INFO: Log properties loaded
        Exception in thread "main" java.lang.UnsatisfiedLinkError:
        /usr/lib/jvm/jdk1.8.0_x86/jre/lib/i386/libawt_xawt.so: libXrender.so.1:
        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:1929)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1083)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1835)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1119)
        at java.awt.Toolkit$3.run(Toolkit.java:1651)
        at java.awt.Toolkit$3.run(Toolkit.java:1649)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1648)
        at java.awt.Toolkit.<clinit>(Toolkit.java:1683)
        at sun.awt.AppContext$2.run(AppContext.java:275)
        at sun.awt.AppContext$2.run(AppContext.java:264)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.AppContext.initMainAppContext(AppContext.java:264)
        at sun.awt.AppContext.access$400(AppContext.java:133)
        at sun.awt.AppContext$3.run(AppContext.java:319)
        at sun.awt.AppContext$3.run(AppContext.java:302)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.AppContext.getAppContext(AppContext.java:301)
        at javax.swing.SwingUtilities.appContextGet(SwingUtilities.java:1860)
        at javax.swing.UIManager.getLAFState(UIManager.java:243)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:529)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:579)
        at mrui.Launcher.main(Unknown Source)
    

    告诉我64位错误消息是因为jMRUI需要32位java,所以这就是为什么我同时拥有它们。

    This site told me the 64bit error message is because jMRUI requires 32bit java, so that's why I have both.

    再次,告诉我32位java无法正常工作,因为我试图在没有32位运行时环境的情况下运行64位系统。

    Again, this site tells me 32bit java isn't working because I am "trying to run a 64bit system without a 32bit runtime environment".

    最后,告诉我在我的jMRUI.sh bash脚本中添加-d32选项。它没有改变共享库错误消息的结果。

    Lastly, this site told me to add the -d32 option in my jMRUI.sh bash script. It did not change the shared library error message outcome.

    我错过了什么?我无法想象我没有提供足够的信息,但如果您还需要其他任何东西来帮助调试,请告诉我,我会按照您的方式发送输出。提前一百万感谢!

    What oh what am I missing? I can't imagine I haven't given enough information, but if you need anything else to help debug this, let me know and I'll send the output your way. Thanks a million in advance!

    推荐答案

    看一下错误信息,我得出一些结论:

    Having a look at the error messages, I have some conclusions:


    • 你肯定需要运行32位版本, jMRUI-4.0 / lib / libfftw.so中的本机库是ELF32

    运行32位版本时,系统会查找缺少的库:'libXrender.so.1'( 32位版本。

    when you run the 32 bit version, the system looks for a missing library: 'libXrender.so.1' (the 32bit version).

    安装包libxrender1:i386(libXrender 32位)并再次使用JDK 32位。

    Install the package "libxrender1:i386" (libXrender 32bit) and try again with JDK 32 bit.

    这篇关于共享库 - 64位Ubuntu上的Java 32位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

  • 08-04 19:35
    查看更多