JDK-8156822 : Application started using javaws now starts in {java.home} rather than current directory
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u91,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-05-10
  • Updated: 2016-10-18
  • Resolved: 2016-05-27
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 7 JDK 8 JDK 9
7u111Fixed 8u102Fixed 9 b124Fixed
Related Reports
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)


ADDITIONAL OS VERSION INFORMATION :
Windows 7 Pro, 64 bit

A DESCRIPTION OF THE PROBLEM :
When using javaws update 91, the application working directory is now an equivalent of {java.home}, rather than the current (command invocation) directory.

As a result, an application invoked as:
$ cd C:\Users\mbrunecky
$ javaws -open Foo.properties <jnlp_url>

trying to open "Foo.properties" attempts to open {java.home}/Foo.properties
instead of "C:\Users\mbrunecky\Foo.properties".
(and obviously fails).
In addition, any files created by such application are created in {java.home}
rather than the current working directory (unless file specification includes an explicit path).

This is another, but more serious consequence than the (related) bug JDK-8154899 (fixed?). The problem is not only an incorrect reporting of the system property "user.home", the problem is that application invocation working directory is WRONG!
(I want to make sure bug 8154899  is 'fixed RIGHT")





REGRESSION.  Last worked in version 8u77

ADDITIONAL REGRESSION INFORMATION: 
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)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Within JNLP application, assuming arguments -open Foo.properties, add line

System.err.println("Arg " + args[0] " + new File(args[1]).getAbsolutePath());

Once invoked using:
javaws -open Foo.properties <jnlp_url>

you will see that instead of resolving Foo.properties to the current working directory, the "Foo.properties" will resolve to {java.home}/Foo.properties


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
javaws -open Foo.properties <jnlp_url>
resolving to
{command working directory}/Foo.properties
ACTUAL -
javaws -open Foo.properties <jnlp_url>
{java.home}/Foo.properties
(file not found)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
None, -open option has become useless

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Revert to java 1.8.0_77


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

Does it affect JDK 9?
13-05-2016

This issue looks like related to the bug JDK-8154899. In addition it seems that the problem is not only incorrect reporting of system property "user.home" (as described in 8154899), the problem is that application invoked from <working directory> now executes in "java.home", making any application file references assuming <working directory> totally wrong. Writing to dev. to confirm if the fix for JDK-8154899 will take care of the supplement issue by default.
11-05-2016