This is an automated email from the ASF dual-hosted git repository.
normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new fb562f4e fix(windows): Escape back-slashes for gradle config jdk path
(#1876)
fb562f4e is described below
commit fb562f4ed0a66e5e02f8b2cab0b035f944e58c86
Author: Norman Breau <[email protected]>
AuthorDate: Tue Dec 16 22:31:10 2025 -0400
fix(windows): Escape back-slashes for gradle config jdk path (#1876)
---
lib/builders/ProjectBuilder.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/builders/ProjectBuilder.js b/lib/builders/ProjectBuilder.js
index 59e9dfbe..4abf379c 100644
--- a/lib/builders/ProjectBuilder.js
+++ b/lib/builders/ProjectBuilder.js
@@ -319,7 +319,9 @@ class ProjectBuilder {
*/
const javaHome = process.env.CORDOVA_JAVA_HOME ||
process.env.JAVA_HOME || false;
if (javaHome) {
- configProperties.set('java.home', javaHome);
+ // Double escape back-slashes so that it is written as
escaped back-slashes
+ // in the gradle config. Primary an issue in window
environments.
+ configProperties.set('java.home', javaHome.replace(/\\/g,
'\\\\'));
} else {
configProperties.unset('java.home');
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]