Java 1.6和Desktop.open()的问题 [英] Problem with Java 1.6 and Desktop.open()

查看:44
本文介绍了Java 1.6和Desktop.open()的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Destop.open()在Windows Vista和XP机器上启动.pdf查看器,并且大多数都能正常工作。但是,在一台XP计算机上,该调用不起作用,仅返回而不会引发任何异常,并且查看器无法启动。据我所知,在该计算机上已正确设置了文件关联:双击.pdf即可,命令提示符下的 start xxx.pdf命令也可以。我以为这一定是Windows配置问题,但不能指责。

I've been using Destop.open() to launch a .pdf viewer on Windows machines, both Vista and XP, and most of them work just fine. However, on one XP machine the call does not work, simply returning without throwing any exceptions, and the viewer does not launch. On that machine the file association is properly set up as far as I can tell: double-clicking a .pdf works, as does the "start xxx.pdf" command on the command prompt. I'm thinking it must be a Windows configuration issue, but can't put my finger on it.

还有其他人看到过此问题吗?

Has anyone else seen this problem?

推荐答案

这是XP SP2早期版本的一个已知问题,ShellExecute函数停止接受URI。

This is a known problem with early versions of XP SP2, the ShellExecute function stopped accepting URIs; bring the XP machines patches up to date.

要查看例外情况,请确保已打开Java控制台:

To view the exceptions make sure the Java Console is turned on:

Control Panel->Java Control Panel->Advanced->Java Console.

这篇关于Java 1.6和Desktop.open()的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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