如何查找Linux上Java Desktop API需要哪些库? [英] How to find which libraries does Java Desktop API require on Linux?

查看:76
本文介绍了如何查找Linux上Java Desktop API需要哪些库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到一种方法来确定Java要使Desktop API正常工作需要哪些库,特别是BROWSE函数.我阅读了一些指南,错误报告和变通办法,但是它们都不起作用.

I am trying to find a way how to determine which libraries does Java require for Desktop API to work, specifically the BROWSE function. I read a few guides, bug reports and workarounds, but none of them work.

我能够通过安装libgnome2-0gvfs-backends软件包使其在Debian上运行.通常建议第一个(由人们解决相同的问题),第二个是个幸运的猜测,因为似乎Desktop API需要vfs.但是,即使安装了这两个软件包,我也无法在Ubuntu 14.04上实现此功能.

I was able to make it work on Debian by installing libgnome2-0 and gvfs-backends packages. The first one is typically recommended (by people solving the same problem), the second one was a lucky guess because it seems that the Desktop API required the vfs. However I can't make this work on Ubuntu 14.04, even with installing these two packages.

所以我的问题是:如何找到Linux上Java Desktop API需要哪些库?特别是Ubuntu 14.04上的Oracle JDK 8.是否有可能以某种方式捕获桌面API使用的是哪个库,或者从本机代码中获取一些错误输出?

So my question is: How can I find which libraries does Java Desktop API require on Linux? Specifically Oracle JDK 8 on Ubuntu 14.04. Is it possible to somehow capture which libraries is the desktop API using or get some error output from the native code?

编辑:我创建了一个单行代码,试图使用浏览器:

EDIT: I've created a one line code that is trying to use the browse:

public class Main {
    public static void main(String[] args) throws URISyntaxException, IOException {
        Desktop.getDesktop().browse(new URI("http://www.google.com"));
    }
}

我试图运行一个命令来跟踪测试执行过程中所请求的所有文件:

I've tried to run a command to trace all files that have been requested during the execution of the test:

strace -e open,access -f -o browse java -jar BrowseTester.jar

我得到很多输出,表明正在寻找,找到和访问java本机库和linux本机库,但是我不确定如何检测实际缺少的内容.

I get a lot of output indicating both java native and linux native libraries are being looked for, found and accessed, but I am not sure how to detect what is actually missing.

输出示例:

30171 open("/usr/lib/x86_64-linux-gnu/gvfs/tls/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
30171 open("/usr/lib/x86_64-linux-gnu/gvfs/tls/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
30171 open("/usr/lib/x86_64-linux-gnu/gvfs/x86_64/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
30171 open("/usr/lib/x86_64-linux-gnu/gvfs/libgvfscommon.so", O_RDONLY|O_CLOEXEC) = 11

我需要一种方法来检测Java Desktop API浏览功能需要哪些本机库.我无法触摸调用浏览器的代码.

I need a way how to detect which native libraries are needed for the Java Desktop API browse functionality. I can't touch the code that is calling the browse.

EDIT2 :我试图在另一台计算机上安装具有完整Gnome环境的新Ubuntu 14.04,并且可以正常工作.但是我真的很想避免这种情况,因为它增加了1.5GB的(主要是)未使用的库.仍在寻找一种方法来查找Java到底需要什么,或者从失败的地方至少找到某种输出.

EDIT2: I've tried to install a new Ubuntu 14.04 with complete Gnome environment on a different machine and it works. However I would really like to avoid this because it adds 1.5GB of (mostly) unused libraries. Still looking for a way how to find what Java requires exactly or at least some kind of output from the place where it fails.

推荐答案

转到 Makefile ,我发现其中包括:

Going to the source might help here. Digging through the Makefile, I find these includes:

EXTRA_INCLUDES = `pkg-config --cflags glib-2.0` \
                 `pkg-config --cflags libgnome-2.0` \
                 `pkg-config --cflags gnome-vfs-2.0`\
                 `pkg-config --cflags gnome-vfs-module-2.0` \
                 `pkg-config --cflags bonobo-activation-2.0` \
                 `pkg-config --cflags libbonobo-2.0` \
                 `pkg-config --cflags ORBit-2.0` \
                 `pkg-config --cflags gconf-2.0`

在那里,你有:)

这篇关于如何查找Linux上Java Desktop API需要哪些库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆