繁体   English   中英

JNLP没有在Java 1.8客户端上创建桌面快捷方式

[英]JNLP not creating desktop shortcut on Java 1.8 clients

我有一个JNLP,它在Java 1.7下为我的应用程序创建了一个桌面快捷方式。 但是,当我在Java 1.8下运行它时,我不再获得桌面快捷方式。 发生了什么变化?

这是我在Windows XP,Windows 7和OS X Yosemite下测试的一个示例,它们都运行Java 1.7并且它为这三个创建了桌面快捷方式,但是在运行Java 1.8的Windows 7和Windows 8上我都没有得到桌面快捷方式。 为了清楚起见,该应用程序显示并正常工作,只是没有创建桌面快捷方式。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN" "http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
<jnlp codebase="http://services.SportsOptions.com/test/" href="test.jnlp">
  <information>
    <title>test</title>
    <vendor>test.com</vendor>
    <homepage href="http://www.test.com/"/>
    <description>Test</description>
    <icon href="splash.png" kind="splash"/>
    <offline-allowed/>
    <shortcut online="true">
      <desktop/>
      <menu submenu="test" />
    </shortcut>
  </information>
  <information os="Linux">
    <icon href="DesktopIcon.ico" kind="shortcut" />
  </information>
  <information os="Windows">
    <icon href="DesktopIcon.ico" kind="shortcut" />
  </information>
  <information os="Mac">
    <icon href="DesktopIcon.icns" kind="shortcut" />
  </information>
  <resources locale="" os="">
    <j2se href="http://java.sun.com/products/autodl/j2se" initial-heap-size="32m" max-heap-size="512m" version="1.6+"/>
    <jar download="eager" href="Test.jar" main="false" version=""/>
  </resources>
  <application-desc main-class="test.Main"/>
</jnlp>

OP的解决方案:

在Java 1.7中,为所有常见信息读取了没有os属性的<information>标记,并且还读取了包含每个OS的<icon>标记的<information os="...">标记。 在Java 1.8中,一旦它看到没有os属性的<information>标签,它就不会读取带有 os属性的那个,这就是我有桌面快捷方式图标的地方。 因此,我必须创建三个单独的<information os="...">标记,每个操作系统一个,但每个操作系统中都复制了所有常见信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM