JDK-8290832 : It is no longer possible to change "user.dir" in the JDK8
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: openjdk8u342
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2022-07-21
  • Updated: 2022-08-01
  • Resolved: 2022-07-31
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.
Other
openjdk8u345 b01Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8291662 :  
Description
The last release of jdk8u includes the fix for JDK-8194154 which disabled the possibility to change the "user.dir" property.

Changing the "user.dir" was not recommended from the beginning but it was not forbidden, so there are some old applications that rely on the old behavior. One of the app which sets the "user.dir" is Gradle. The Gradle has a notice in the documentation for the user:
"Never use new File(relative path) because this creates a path relative to the current working directory (CWD). Gradle can make no guarantees about the location of the CWD, which means builds that rely on it may break at any time".

But for compatibility reasons they still set the "user.dir" property, so the old plugins will work. 
Now that compatibility is broken due to the fix I mention. We found such apps immediately after the release.

I think we should roll it back as soon as possible. Here we can discuss it further.

See some discussion here:
https://mail.openjdk.org/pipermail/jdk8u-dev/2022-July/015249.html
Comments
Changeset: 2dadc2bf Author: Sergey Bylokhov <serb@openjdk.org> Date: 2022-07-31 04:01:56 +0000 URL: https://git.openjdk.org/jdk8u/commit/2dadc2bf312d5f947e0735d5ec13c285824db31d
31-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u/pull/14 Date: 2022-07-29 03:46:56 +0000
29-07-2022

Fix request (8u) - Justification: This is a request to restore the old behavior and revert the fix for https://bugs.openjdk.org/browse/JDK-8194154 in the jdk8u, since it is caused some issues. The test added by the initial version of PR was used for fix verification: https://github.com/openjdk/jdk8u-dev/pull/88/commits/1f51111d8abe078c325ab6b761596a4c7769c180 This test will be contributed via separate PR as suggested in the PR. - Risk Analysis: Low PR: https://github.com/openjdk/jdk8u-dev/pull/88
22-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/88 Date: 2022-07-21 19:46:44 +0000
21-07-2022