JDK-8154899 : System property 'user.dir' now set to 'java.home' value rather than user's working directory
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u91,8u102,9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-04-21
  • Updated: 2020-04-18
  • Resolved: 2016-05-03
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 6 JDK 7 JDK 8 JDK 9
6u121Fixed 7u111Fixed 8u102Fixed 9 b120Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

Java Web Start 11.91.2.14

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
The system property 'user.dir' which previously resolved to the user's working directory is now resolving to the 'java.home' value when a JNLP application is launched using java web start packaged in Java 8 u91 on Windows.

This does not appear to be broken in the OS X version. 

REGRESSION.  Last worked in version 8u77

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

Java Web Start 11.77.2.03

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run any JNLP app with the Java Webstart console displayed.  Press 's' to print the system properties.

With Java Web Start 11.77.2.03 or previous the user's working directory is shown. For Java Web Start 11.91.2.14 the java.home directory is shown.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expect 'user.dir' to show the user's working directory


Java Web Start 11.77.2.03
Using JRE version 1.8.0_77-b03 Java HotSpot(TM) 64-Bit Server VM

java.home = C:\Users\David\Downloads\jre-8u77-windows-x64.tar\jre1.8.0_77
java.io.tmpdir = C:\Users\DAVID\AppData\Local\Temp\
java.library.path = C:\Users\David\Downloads\jre-8u77-windows-x64.tar\jre1.8.0_77\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Mozilla Firefox;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;"C:\Users\David\Downloads\jre-8u77-windows-x64.tar\jre1.8.0_77\bin";.
java.protocol.handler.pkgs = com.sun.javaws.net.protocol|com.sun.deploy.net.protocol|com.sun.deploy.net.protocol
java.rmi.server.RMIClassLoaderSpi = com.sun.jnlp.JNLPRMIClassLoaderSpi
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.8.0_77-b03
java.security.manager = 
java.security.policy = file:C:\Users\David\Downloads\jre-8u77-windows-x64.tar\jre1.8.0_77\lib\security\javaws.policy
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_77
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.77-b03
javaplugin.proxy.config.type = direct
javawebstart.version = javaws-11.77.2.03

user.dir = C:\Program Files (x86)\Mozilla Firefox
ACTUAL -
'user.dir' shows the java.home directory.


Java Web Start 11.91.2.14
Using JRE version 1.8.0_91-b14 Java HotSpot(TM) 64-Bit Server VM

java.home = C:\Users\David\Downloads\jre-8u91-windows-x64.tar\jre1.8.0_91
java.io.tmpdir = C:\Users\DAVID\AppData\Local\Temp\
java.library.path = C:\Users\David\Downloads\jre-8u91-windows-x64.tar\jre1.8.0_91\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Mozilla Firefox;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;"C:\Users\David\Downloads\jre-8u91-windows-x64.tar\jre1.8.0_91\bin";.
java.protocol.handler.pkgs = com.sun.javaws.net.protocol|com.sun.deploy.net.protocol|com.sun.deploy.net.protocol
java.rmi.server.RMIClassLoaderSpi = com.sun.jnlp.JNLPRMIClassLoaderSpi
java.runtime.name = Java(TM) SE Runtime Environment
java.runtime.version = 1.8.0_91-b14
java.security.manager = 
java.security.policy = file:C:\Users\David\Downloads\jre-8u91-windows-x64.tar\jre1.8.0_91\lib\security\javaws.policy
java.specification.name = Java Platform API Specification
java.specification.vendor = Oracle Corporation
java.specification.version = 1.8
java.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
java.version = 1.8.0_91
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Oracle Corporation
java.vm.specification.version = 1.8
java.vm.vendor = Oracle Corporation
java.vm.version = 25.91-b14
javaplugin.proxy.config.type = direct
javawebstart.version = javaws-11.91.2.14

user.dir = C:\Users\David\Downloads\jre-8u91-windows-x64.tar\jre1.8.0_91

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Launch one of the Java tutorial examples e.g.:

https://docs.oracle.com/javase/tutorialJWS/samples/uiswing/BorderDemoProject/BorderDemo.jnlp
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Revert to older java version


Comments
Verified with jre9-b179 on win7/x86
21-07-2017

UR SQE OK to take JDK-8154899 and JDK-8156822 to PSU16_03
06-06-2016

Do we need backport it to jdk7/6? I see JDK-8148252 has been backport in the older trains.
04-05-2016

Possible workaround is to set "user.dir" in Java Control Panel. -Duser.dir=C:\\Users\\"USERNAME"\\Desktop
27-04-2016

Checked this for the following versions and could confirm the issue in 8u91 and onwards. Result: =========== 8u77 - OK user.dir = C:\Users\username\Desktop java.home = C:\Program Files (x86)\Java\jre1.8.0_77 8u91 b14 - FAIL user.dir = C:\Program Files (x86)\Java\jre1.8.0_91 java.home = C:\Program Files (x86)\Java\jre1.8.0_91 8u92 b14 - FAIL user.dir = C:\Program Files (x86)\Java\jre1.8.0_92 java.home = C:\Program Files (x86)\Java\jre1.8.0_92 8u102 b03 - FAIL user.dir = C:\Program Files (x86)\Java\jre1.8.0_102 java.home = C:\Program Files (x86)\Java\jre1.8.0_102 9 ea b115 - OK with NPE user.dir = C:\Users\username\Desktop java.home = C:\Program Files\Java\jre-9 Webstart fails to run with 9ea b115 with NPE: java.lang.NullPointerException at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62) According to java se 8 documentation: ============================== https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html "user.dir" User working directory "java.home" Installation directory for Java Runtime Environment (JRE) https://docs.oracle.com/javase/8/docs/api/java/lang/System.html user.dir User's current working directory java.home Java installation directory Moving this up for dev. to evaluate further.
21-04-2016