Java Desktop browser() 打开 %u 而不是 URI
嗯,我想标题已经说明了这一点。 当尝试使用桌面的 browser() 函数启动默认浏览器时,浏览器确实打开,但指向错误的 URI beeing %u
我无法将其缩小到代码,因为我没有更改它。 我所做的更改是操作系统现在是 Ubuntu 11.10 而不是 11.04
我安装了 Java 7,但继续使用 Java 6。
哪里出了问题?有什么线索吗?
Well, the title says it I guess.
When trying to launch the default browser by using the Desktop's browse() function, the browser does open but points to the wrong URI beeing %u
I can't narrow it down to the code, as I haven't changed it.
What I did change was the OS now beeing Ubuntu 11.10 instead of 11.04
And I installed Java 7, but keep using Java 6.
Where does it go wrong? Any Clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道我迟到了,但我也遇到了同样的问题。感谢这个问题中的所有好的提示和上面的评论,我在 gconf-editor 中找到了一个配置键:
/desktop/gnome/url-handlers/http/command (和类似的)
我在这个键中找到的命令是“firefox %u”。不幸的是,该键并没有得到很好的记录,但我注意到该区域的其他键使用“%s”作为参数。所以我尝试用“%s”替换“%u”,然后 - 耶! - 这该死的东西又起作用了。
我还想利用这个机会感谢 Canonical 的员工将 Unity 搞得如此彻底。
I know I'm late to the game but I had the same problem, too. Thanks to all the good hints in this question and the comments above I found a config key in gconf-editor:
/desktop/gnome/url-handlers/http/command (and similar)
The command that I found in this key was "firefox %u". Unfortunately, the key was not really documented very well but I noticed that other keys in that area used "%s" for the parameter. So I tried and replaced "%u" by "%s" and - yay! - the darn thing works again.
I'd also like to use this opportunity to thank the guys at Canonical for messing up Unity so thoroughly.