You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by no...@apache.org on 2025/12/17 02:31:16 UTC

(cordova-android) branch master updated: fix(windows): Escape back-slashes for gradle config jdk path (#1876)

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 <no...@breautek.com>
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: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org