From 28d4e86d5d8dde6ac13cbfbef4a6491ef42321e4 Mon Sep 17 00:00:00 2001 From: Arun Venmany Date: Wed, 25 Feb 2026 18:06:13 +0530 Subject: [PATCH] adding JAVA_HOME env variable for product info based on java.home Signed-off-by: Arun Venmany --- .../tools/common/plugins/util/InstallFeatureUtil.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/InstallFeatureUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/InstallFeatureUtil.java index d06597c1f..49276e265 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/InstallFeatureUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/InstallFeatureUtil.java @@ -1151,7 +1151,14 @@ public static String productInfo(File installDirectory, String action) throws Pl } else { productInfoFile = installDirectory + "/bin/productInfo"; } + ProcessBuilder pb = new ProcessBuilder(productInfoFile, action); + Properties sysp = System.getProperties(); + String javaHome = sysp.getProperty("java.home"); + if (javaHome != null) { + pb.environment().put("JAVA_HOME", javaHome); + } + pb.redirectErrorStream(true); pr = pb.start(); in = new BufferedReader(new InputStreamReader(pr.getInputStream()));