JDK-8160365 : Desktop shortcut of Web Start application is broken after JRE update
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u77,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2016-06-27
  • Updated: 2018-07-06
  • Resolved: 2017-09-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u152Fixed
Description
FULL PRODUCT VERSION :
JDK 10, JDK 9, JDK 8u77

ADDITIONAL OS VERSION INFORMATION :
MS Window 7 OS

A DESCRIPTION OF THE PROBLEM :
Desktop and menu shortcuts of Java Web Start applications are linked to "javaws.exe" binary file from a specific JRE installation, therefore when JRE is upgraded, for example, JRE 8u91 is newly installed and JRE 8u77 is uninstalled, the existing shortcuts become not functioning, since they refer to nonexistent "<JRE_8u77_HOME_DIR>\bin\javaws.exe" file.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.  Upload JAR, JNLP files of the test case to the same directory on an accessible web server.
2.  Edit JNLP file of the test case uploaded to the web server in step #1 by setting the appropriate URL value, which is URL of the directory with JAR, JNLP files of the test case on the web server, to "codebase" attribute of "jnlp" element. Save the changes in the file.
3.  Make sure that on the host there are both administrator and simple user accounts.
4.  Log in with the administrator account. Uninstall all JREs from the host.
5.  Install JRE from any of the release families: 10, 9 or 8 which is not the latest available JRE from the chosen release family, for example JRE 8u77. Log out.
6.  Log in with the simple user account, open Internet Explorer (IE) browser and load JNLP file of the test case uploaded to the web server. Agree to create the shortcuts. Verify that the shortcuts "ShortcutIsBrokenAfterJREUpdate.lnk" for the test case were created on desktop and MS Windows "Start Menu". Log out.
7.  Log in with the administrator account, install JRE whose update version is greater within the same release family with the JRE installed in the step #5, for example JRE 8u91. During installation agree to uninstall JRE from the step #5, log out.
8.  Log in with the simple user account, try to launch "ShortcutIsBrokenAfterJREUpdate" test case using the existing desktop shortcut. The bug is reproduced, if the shortcut does not function and "ShortcutIsBrokenAfterJREUpdate" application cannot be launched.
Comments
The minimal test case was attached to the bug record as the file "ShortcutIsBrokenAfterJREUpdate.zip".
11-09-2017

as part of JDK-8043453, a mechanism was put in javaws such that invoking "javaws -fix -shortcut" will repair the path to all existing shortcuts for that user. installer may invoke this, but that only helps the user that runs the installer. At the least that indicates a workaround (user can invoke "javaws -fix -shortcut"). We may also wish to consider invoking this from the JCP, so that user can repair shortcuts just by invoking the JCP. given the work-around I am downgrading to P4 (wrt JDK9) and re-targeting to tbd-minor
18-01-2017

The issue was reproduced on MS Windows 7 OS, when JRE 8 was upgraded from JRE 8u77 b03 to JRE 8u91 b15. The issue could not be reproduced, if all operations were accomplished by administrator account only. Was able to define that Java Web Start from JRE 8 builds previous to JRE 8u20 b22 was creating desktop and menu shortcuts to Java Web Start applications which referred to "javaws.exe" binary with the universal path "C:\Windows\SysWOW64\javaws.exe", but starting from JRE 8u20 b22 the created shortcuts refer to "javaws.exe" binary from the JRE 8 home directory, whose name is unique for each JRE 8 update, for example "C:\Program Files (x86)\Java\jre1.8.0_20\bin\javaws.exe". This change in creation of shortcuts is a result of the fix for the bug JDK-8043453. Currently I suppose that it would be close to impossible to search for all desktop and menu shortcuts connected with Java cache entries located in profiles of all users on a host during JRE upgrade and to alter the paths to "javaws.exe" file in these shortcuts. In case, if the solution is based on creation of the shortcuts referring to "javaws.exe" file via the universal path "C:\ProgramData\Oracle\Java\javapath\javaws.exe", all already created shortcuts referring to "javaws.exe" from JRE being uninstalled will not be corrected.
12-10-2016