Skip to content

Commit

Permalink
Updated the tools.jar location to be taken from the SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
annaibm committed Oct 10, 2024
1 parent c21e789 commit 0da87af
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stf.build/include/top.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ limitations under the License.
<pathelement location="${first_prereqs_root}/log4j/log4j-core.jar"/>
</path>
<path id="tools.class.path">
<pathelement location="${first_prereqs_root}/tools/tools.jar"/>
<pathelement location="${java.home}/../lib/tools.jar"/>
</path>
<path id="asm.class.path">
<pathelement location="${first_prereqs_root}/asm/asm.jar"/>
Expand Down Expand Up @@ -332,9 +332,9 @@ limitations under the License.
-->

<target name="configure-tools-jar" depends="setup-java-properties" unless="${tools_jar_correct}">
<property name="tools_jar_origin" value="${java_bindir}/../lib/tools.jar"/>
<property name="tools_jar_origin" value="${java.home}/../lib/tools.jar"/>
<echo message="configure-tools-jar: Copying ${tools_jar_origin} to ${tools_jar_dir}"/>
<copy file="${tools_jar_origin}" todir="${tools_jar_dir}"/>
<copy file="${tools_jar_origin}" todir="${tools_jar_dir}"/>
<property name="tools_jar" value="${tools_jar_dir}/${tools_jar_file}"/>
<available file="${tools_jar_dir}/${tools_jar_file}" property="tools_jar_correct"/>
</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package net.adoptopenjdk.stf.environment;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Pattern;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ public StfEnvironmentCore(ArrayList<PropertyFileDetails> 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");
this.testRoots.add(new DirectoryRef(javaLibDir.getCanonicalPath())); // Add ../lib directory
} 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()) {
Expand Down

0 comments on commit 0da87af

Please sign in to comment.