Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JNLP not creating desktop shortcut on Java 1.8 clients

Tags:

java

java-8

jnlp

I have a JNLP which creates a desktop shortcut to my application under Java 1.7. However, when I run it under Java 1.8, I no longer get the desktop shortcut. What has changed?

Here is an example that I tested under Windows XP, Windows 7, and OS X Yosemite, all running Java 1.7 and it created the desktop shortcut for all three, but on both Windows 7 and Windows 8 running Java 1.8 I don't get the desktop shortcut. Just to be clear, the app shows up and works fine, just the desktop shortcut is not being created.

<?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>
like image 705
user1828108 Avatar asked Nov 14 '14 01:11

user1828108


1 Answers

OP's solution:

In Java 1.7, the <information> tag without the os attribute was read for all the common info, and it also read the <information os="..."> tag which contained the <icon> tag for each individual OS. In Java 1.8, once it sees the <information> tag without the os attribute, it does not read the one with the os attribute, which is where I had the icon for the desktop shortcut. So I had to create three separate <information os="..."> tags, one for each OS, but with all the common info duplicated in each one.

like image 102
dimo414 Avatar answered Sep 22 '22 04:09

dimo414