0

I have a Java Webstart application, that is launched via network. Therefore the hostname of the server and of the JNLP file changes with the IP of the server.
The webstart creates a shortcut on the desktop.

The thing is, that the shortcut is recreated with every launch and thereby its position on the desktop (at least under windows - tested on XP and Windows 7) changes everytime.
This happens until the shortcut is renamed. Afterwards it behaves, like it should and isn't recreated anymore.

Does Anybody know, why this happens and how to avoid it (automatically - meaning not manually renaming the shortcut).

Here is an example for a JNLP file:

<jnlp spec="1.0+" codebase="http://localhost:8080/myapp/" href="http://localhost:8080/myapp/MyApp.jnlp">
  <information>
    <title>MyApp</title>
    <vendor>MeAndI</vendor>
    <homepage href="http://www.MyApp.com"/>
    <description>The client for MyApp </description>
    <description kind="tooltip">The client for MyApp </description>
    <icon href="http://localhost:8080/myapp/icon.png" kind="default"/>
    <icon href="http://localhost:8080/myapp/icon.ico" kind="shortcut"/>
    <shortcut online="true" install="false">
      <desktop/>
      <menu submenu="MyApp"/>
    </shortcut>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="timeout" policy="always"/>
  <resources>
    <java initial-heap-size="268435456" max-heap-size="536870912" version="1.5+"/>
    <jar href="http://localhost:8080/myapp/MyAppClient.jar" download="eager" main="false"/>
    <!-- some more jar referemces ... -->
  </resources>
  <application-desc main-class="com.meandi.myapp.core.gui.LoginScreen"/>
</jnlp>

Thank you in advance.

Regards, Schorsch.

1 Answer 1

0

It's an old question, but I hope this is useful to somebody.

The reasons why the icon is always recreated and moving on desktop are:

  1. There is no version attribute defined in the jnlp element. Since update policy is set to "always", WebStart will always reinstall your application, and so the icon is recreated.
  2. Windows has a rule to where it adds new desktop icons. It depends on if you set Windows to sort desktop icons, but most people will do it manually - in which case new icons go to the first available space from top left to bottom right, vertical before horizontal.
4
  • I can rule the 2. point out, at least for my case, but it might be the version thing. Thank you.
    – Schorsch
    May 22, 2015 at 6:19
  • I got the icon re-created problem myself now and my search led me back here. The irony. In my JNLP I have version defined, my update policy is prompt, and I checked the items in Java deployment cache - the JAR itself is not redeployed, but the desktop icon is when the icon is clicked.
    – KC Wong
    Jun 2, 2015 at 4:04
  • I finally found the reason. Web Start is reinstalling every time because I have specified multiple icons of different sizes. I removed all but one of them and Web Start stopped recreating the shortcut.
    – KC Wong
    Aug 10, 2015 at 2:51
  • That doesn't count for me. We have always been using just one icon. Although it was replaced once, it did happen before. But thanks anyway.
    – Schorsch
    Aug 11, 2015 at 4:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.