Skip to content

Commit 56161cd

Browse files
committed
Remove find-java-rt-jar.sh, document how -b interacts with older JDKs
* Remove the use of the `find-java-rt-jar.sh` script in CI, as this is no longer necessary with the advent of `--java-bin-dirs`/searching the `PATH` for Java. This fixes #1061. * Now that `find-java-rt-jar.sh` is gone, there is no longer any need for the `.github/PropertiesTest.java` utility, nor is there any need for the `find_java` bash function that leverages this. This patch remove both of them as well. * On a related note, it turns out that SAW's approach to detecting where `rt.jar` lives likely doesn't work on pre-7 JDKs on macOS. Given how ancient these versions of Java anymore, let's just document this infelicity in the manual and describe a workaround for those brave enough to try this. Fixes #1062.
1 parent 31914b2 commit 56161cd

File tree

5 files changed

+14
-43
lines changed

5 files changed

+14
-43
lines changed

.github/PropertiesTest.java

-7
This file was deleted.

.github/ci.sh

-11
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ install_system_deps() {
166166
}
167167

168168
test_dist() {
169-
find_java
170169
pushd intTests
171170
env
172171
LOUD=true ./runtests.sh
@@ -197,16 +196,6 @@ bundle_files() {
197196
cp -r examples/* dist/examples
198197
}
199198

200-
find_java() {
201-
pushd .github
202-
javac PropertiesTest.java
203-
RT_JAR="$(java PropertiesTest | tr : '\n' | grep rt.jar | head -n 1)"
204-
export RT_JAR
205-
echo "RT_JAR=$RT_JAR" >> "$GITHUB_ENV"
206-
rm PropertiesTest.class
207-
popd
208-
}
209-
210199
sign() {
211200
gpg --batch --import <(echo "$SIGNING_KEY")
212201
fingerprint="$(gpg --list-keys | grep galois -a1 | head -n1 | awk '{$1=$1};1')"

doc/manual/manual.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -1557,8 +1557,14 @@ control where to look for classes:
15571557
files found in that directory (and its subdirectories) to the class database.
15581558
By default, the current directory is included in the class path.
15591559

1560-
Most Java programs will only require setting the `-b` flag, as that is enough
1561-
to bring in the standard Java libraries.
1560+
Most Java programs will only require setting the `-b` flag (or the `PATH`), as
1561+
that is enough to bring in the standard Java libraries. Note that when
1562+
searching the `PATH`, SAW makes assumptions about where the standard library
1563+
classes live. These assumptions are likely to hold on JDK 7 or later, but they
1564+
may not hold on older JDKs on certain operating systems. If you are using an
1565+
old version of the JDK and SAW is unable to find a standard Java class, you may
1566+
need to specify the location of the standard classes' JAR file with the `-j`
1567+
flag (or, alternatively, with the `SAW_JDK_JAR` environment variable).
15621568

15631569
Once the class path is configured, you can pass the name of a class to
15641570
the `java_load_class` function.

intTests/runtests.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ fi
3636

3737
# Build the class path. On Windows, Java requires Windows-style paths
3838
# here, even in Cygwin.
39-
#
40-
# Locate rt.jar. This is already a Windows path on windows, so no need
41-
# to 'cygpath' it.
42-
JDK=$(support/find-java-rt-jar.sh)
43-
CP="$JDK"
39+
CP=""
4440
# Add our bundled .jars to the class path.
4541
for i in "$TESTBASE"/jars/*.jar; do
4642
if [ "$OS" == "Windows_NT" ]; then
4743
i=$(cygpath -w "$i")
4844
fi
49-
CP=$CP$CPSEP$i
45+
if [ -z "$CP" ]; then
46+
CP=$i
47+
else
48+
CP=$CP$CPSEP$i
49+
fi
5050
done
5151
export CP
5252

intTests/support/find-java-rt-jar.sh

-17
This file was deleted.

0 commit comments

Comments
 (0)