Java在Linux arm64上错误地下载了x86库。

huangapple 未分类评论64阅读模式
英文:

java on Linux arm64 downloads x86 libraries by mistake

问题

我有一个需要gtk库的Java 7应用程序。我已经安装了适用于Ubuntu 18.04的库。然而,这些似乎不兼容。

我注意到有一个临时的Java库下载文件夹:

~/.swt/lib/linux/aarch64

在这里,应用程序或Java引擎会不断下载丢失的库依赖,例如:

libswt-gtk-4234.so

但是对这些文件的检查显示它是一个x86库!!!

libswt-gtk-4234.so:ELF 64位LSB共享对象,x86-64,版本1(SYSV),动态链接,剥离

我想知道是否可以控制这个过程,让Java下载aarch64库。

我尝试过在以下目录中链接所有的库:

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/aarch64

但是这些库有不同的版本号

libswt-gtk-4919.so 而不是 libswt-gtk-4234.so 

而且x86库最终还是会被下载。

我尝试过手动将 libswt-gtk-4919.so 链接到 libswt-gtk-4234.so,但Java应用程序会出现 UnsatisfiedLinkError:类型错误的故障。

我需要找出如何让Java下载正确架构的库,或者自己找到正确的库放在那里。

我相信这些库是Eclipse的一部分(但不确定)。

英文:

I have a java 7 application that requires gtk libraries. I have installed those available on Ubuntu 18.04. However these don't seem to be compatible.

I have noticed that there is what appears to be a temp java library download folder:

~/.swt/lib/linux/aarch64

Where the application or java engine keeps downloading missing library dependencies for instance:

libswt-gtk-4234.so

But a file of these reveals it is a x86 library!!!

libswt-gtk-4234.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

I was wondering if this can be controlled and I can make java download the aarch64 libraries instead.

I have tried linking all the libraries in :

ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/aarch64

But these libraries have different version numbers

libswt-gtk-4919.so instead of libswt-gtk-4234.so 

and the x86 will end up downloading anyway.

I have tried manually linking libswt-gtk-4919.so to libswt-gtk-4234.so but the java application faults with UnsatisfiedLinkError: type errors.

I need to figure out how to make the java download the correct architecture libraries or find the correct libraries myself to place there.

I believe these libraries are part of eclipse (but not sure).

huangapple
  • 本文由 发表于 2020年5月3日 16:07:38
  • 转载请务必保留本文链接:https://java.coder-hub.com/61571393.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定