From 15129663a02645d0dcbc3a0a18a94b0c3cee2527 Mon Sep 17 00:00:00 2001 From: Anna Babu Palathingal <148897727+annaibm@users.noreply.github.com> Date: Wed, 2 Oct 2024 17:08:05 -0400 Subject: [PATCH] Updated the tools.jar location to be taken from the SDK --- stf.build/include/top.xml | 6 +++--- .../stf/environment/StfEnvironmentCore.java | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/stf.build/include/top.xml b/stf.build/include/top.xml index f0f9f12..43ce102 100644 --- a/stf.build/include/top.xml +++ b/stf.build/include/top.xml @@ -132,7 +132,7 @@ limitations under the License. - + @@ -332,9 +332,9 @@ limitations under the License. --> - + - + diff --git a/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/StfEnvironmentCore.java b/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/StfEnvironmentCore.java index 5935ba9..23514ba 100644 --- a/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/StfEnvironmentCore.java +++ b/stf.core/src/stf.core/net/adoptopenjdk/stf/environment/StfEnvironmentCore.java @@ -94,6 +94,18 @@ public StfEnvironmentCore(ArrayList propertyFileDetails, Ar this.testRoots.add(defaultTestRoot); invocationProperties.put(Stf.ARG_TEST_ROOT.getName(), defaultTestRoot.getSpec()); } + + try { + String javaHome = System.getProperty("java.home"); + File javaLibDir = new File(javaHome, "../lib"); + if (javaLibDir.exists() && javaLibDir.isDirectory()) { + this.testRoots.add(new DirectoryRef(javaLibDir.getCanonicalPath())); + } else { + System.out.println("Java lib directory does not exist: " + javaLibDir.getCanonicalPath()); + } + } catch (IOException e) { + throw new RuntimeException("Failed to add Java lib directory to test roots", e); + } // Work out where the prereqs are if (!getProperty(Stf.ARG_SYSTEMTEST_PREREQS).isEmpty()) {