java.library.path 中没有 swt-mozilla-gtk-4332

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25901117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 08:55:06  来源:igfitidea点击:

no swt-mozilla-gtk-4332 in java.library.path

javalinuxcentosswt

提问by Sarah Weinberger

(See update at bottom for new information.)

(有关新信息,请参阅底部的更新。)

I have a Java SWT application that includes an integrated browser.

我有一个包含集成浏览器的 Java SWT 应用程序。

Everything works fine on Windows and on CENTOS 6.5. I was asked to get the application to work on a new computer to which I installed CENTOS 7.

在 Windows 和 CENTOS 6.5 上一切正常。我被要求让应用程序在我安装了 CENTOS 7 的新计算机上运行。

I keep receiving the no swt-mozilla-gtk-4332 in java.library.path error message.

我一直在 java.library.path 错误消息中收到 no swt-mozilla-gtk-4332 。

I am aware of the various pages that talk on this issue. For instance:

我知道讨论这个问题的各个页面。例如:

StackOverflow 10165693, 6518568, 7130980

StackOverflow的1016569365185687130980

Jazz.net, Eclipse.org

爵士网Eclipse.org

I am using Firefox 24.8.0. That came with CENTOS 7. I just updated all the software too.

我正在使用 Firefox 24.8.0。CENTOS 7 自带的。我也刚刚更新了所有软件。

The references indicated that I should have OpenJDK, which I do. That is the only version that can execute Java.

参考资料表明我应该有 OpenJDK,我就是这样做的。那是唯一可以执行 Java 的版本。

I installed per another recommendation xulrunner (yum install xulrunner).

我根据另一个建议安装了 xulrunner (yum install xulrunner)。

I set: MOZILLA_FIVE_HOME=/usr/lib/mozilla (Some say to use that others say not to. I tried both. Also, one issue said to point to that to "/usr/lib64/xulrunner" less the double quotes, but that did not work. Yes, this folder exists.)

我设置:MOZILLA_FIVE_HOME=/usr/lib/mozilla(有人说要使用,其他人说不要。我都试过了。另外,一个问题说指向“/usr/lib64/xulrunner”少了双引号,但是这不起作用。是的,此文件夹存在。)

587 people and counting gave thumbs up to the Ubuntu solution of:

有 587 人和计数对 Ubuntu 解决方案竖起大拇指:

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

There is no jni folder, and any ways that option did not work.

没有 jni 文件夹,并且该选项不起作用的任何方式。

As I mentioned there is only one a program, so

正如我提到的,一个程序只有一个,所以

sudo update-alternatives --config java

was of no use.

没有用。

What could the problem be and how to solve it? Since the CENTOS 6.5 machine works (maybe because of a missing software package?) and 7 does not, it cannot be just that I need to add something to my jar file, as it worked before.

问题可能是什么以及如何解决?由于 CENTOS 6.5 机器可以工作(可能是因为缺少软件包?)而 7 不能,所以不能只是我需要在我的 jar 文件中添加一些东西,因为它以前可以工作。

Note: here is my /etc/profile.d/java.sh file content:

注意:这是我的 /etc/profile.d/java.sh 文件内容:

export MOZILLA_FIVE_HOME=/usr/lib/mozilla
export LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}

Here is the actual error output.

这是实际的错误输出。

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME='/usr/lib/mozilla'] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-mozilla-gtk-4332 in java.library.path
    no swt-mozilla-gtk in java.library.path
    /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4332.so: libxpcom.so: cannot open shared object file: No such file or directory
    Can't load library: /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so
)
    at org.eclipse.swt.SWT.error(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source)
    at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
    at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
    at prjNetAccelerator.AppMain.createContents(Unknown Source)
    at prjNetAccelerator.AppMain.open(Unknown Source)
    at prjNetAccelerator.AppWrapper.doLaunch(Unknown Source)
    at prjNetAccelerator.AppWrapper.main(Unknown Source)
    ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-mozilla-gtk-4332 in java.library.path
    no swt-mozilla-gtk in java.library.path
    /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk-4332.so: libxpcom.so: cannot open shared object file: No such file or directory
    Can't load library: /home/hts/.swt/lib/linux/x86_64/libswt-mozilla-gtk.so

    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
    ... 12 more

Update

更新

The error text showed the problem, namely that the system could not find libxpcom.so. Mozilla (xulruntime) in version 22.0 replaced the files, libxpcom.so and mozsqlite3.so, with libxul.so. The file, libsmozsqlite3.so stayed for a few more versions than disappeared as well. All other files are the same as version 28.x, which is the current version as of today (2014.09.18).

错误文本显示了问题,即系统找不到libxpcom.so。22.0 版中的 Mozilla (xulruntime) 用 libxul.so 替换了文件 libxpcom.so 和 mozsqlite3.so。文件 libsmozsqlite3.so 保留了几个版本而不是消失了。所有其他文件与版本 28.x 相同,这是截至今天 (2014.09.18) 的当前版本。

The integrated SWT browser for some reason wants the older version, even though it is not there. The questions are:

出于某种原因,集成的 SWT 浏览器需要旧版本,即使它不存在。问题是:

  • What is the mechanism that SWT determines which version of the Gecko GTK+ / xulrunner to use?
  • Would a newer version of SWT, although I thought that my version with Eclipse Kepler was current, solve the problem?
  • How do I get SWT to target the new version?
  • Is the problem Firefox or Chrome or what related?
  • SWT 决定使用哪个版本的 Gecko GTK+/xulrunner 的机制是什么?
  • 尽管我认为我的 Eclipse Kepler 版本是最新版本,但更新版本的 SWT 会解决问题吗?
  • 如何让 SWT 以新版本为目标?
  • 问题是 Firefox 还是 Chrome 还是什么相关的?

I understand most of the problem now, but not all of it.

我现在明白了大部分问题,但不是全部。

I see that Eclipse is at Luna now, so that may solve the problem, have to check. That usually means an updated SWT library. I really thought that Java was version independent, but I guess not entirely.

我看到Eclipse现在在Luna,所以可能会解决问题,必须检查。这通常意味着更新的 SWT 库。我真的认为 Java 是独立于版本的,但我想并非完全如此。

采纳答案by Sarah Weinberger

I was on SWT/GTK+ v4.3 and needed to download and update to SWT/GTK+ v4.4 (or the beta of v4.5), which supports the new GTK+ introduced in GTK version v22.* and present in CENTOS 7. See comment from Baz and myself.

我使用的是 SWT/GTK+ v4.3,需要下载并更新到 SWT/GTK+ v4.4(或 v4.5 的测试版),它支持 GTK 版本 v22.* 中引入的新 GTK+,并出现在 CENTOS 7 中。请参阅 Baz 和我自己的评论。

回答by marengaz

i just had this same error on Ubuntu 14.04 and solved it by installing an older version:

我刚刚在 Ubuntu 14.04 上遇到了同样的错误,并通过安装旧版本解决了这个问题:

sudo apt-get install libwebkitgtk-1.0-0

libwebkitgtk-3.0-0was already installed

libwebkitgtk-3.0-0已经安装

回答by Reitenator

For Linux Mint 19it worked with this (same as marengaz' answer)

对于Linux Mint 19,它适用于这个(与 marengaz 的回答相同)

sudo apt-get install libwebkitgtk-1.0-0

回答by Vanderci Curvelo Junior

I tried something like

我试过类似的东西

sudo yum install libwebkitgtk-1.0-0

须藤 yum 安装 libwebkitgtk-1.0-0

on fedora 28 and I got this message

在 Fedora 28 上,我收到了这条消息

" Last metadata expiration check: 0:33:01 ago on Wed 02 Jan 2019 06:38:13 PM -02. No match for argument: libwebkitgtk-1.0-0 Error: Unable to find a match "

“上次元数据过期检查:2019 年 1 月 2 日星期三下午 06:38:13 -02 前 0:33:01。参数不匹配:libwebkitgtk-1.0-0 错误:无法找到匹配项”

As a read in this post

作为阅读这篇文章

https://community.hitachivantara.com/thread/13998-problems-with-libwebkitgtk-10-0

https://community.hitachivantara.com/thread/13998-problems-with-libwebkitgtk-10-0

There is no suport for version 1 of libwebkitgtk on fedora

Fedora 上没有对 libwebkitgtk 版本 1 的支持

回答by WMS

sudo apt-get install libwebkitgtk-1.0-0

须藤 apt-get 安装 libwebkitgtk-1.0-0

I tested many java versions, think that it was java. But what really makes sense was to install libwebkitgtk for versions 7.1 and 8.0 of pentaho data integration.

我测试了很多java版本,认为是java。但真正有意义的是为 pentaho 数据集成的 7.1 和 8.0 版安装 libwebkitgtk。