langtools/test/tools/javac/Paths/MineField.sh
changeset 41638 7b8819e22551
parent 38517 51a0187f11f6
--- a/langtools/test/tools/javac/Paths/MineField.sh	Thu Oct 20 13:44:51 2016 -0700
+++ b/langtools/test/tools/javac/Paths/MineField.sh	Thu Oct 20 16:31:42 2016 -0700
@@ -109,9 +109,15 @@
 echo 'public class Main {public static void main(String[] a) {Lib.f();}}' > Main.java
 
 # Create a jar file that is good enough to put on the javac boot class path (i.e. contains java.lang.**)
-Sys "$jimage" extract --dir modules ${TESTJAVA}/lib/modules
-Sys "$jar" cf java-lang.jar -C modules/java.base java/lang
-Sys rm -rf modules
+if [ -r ${TESTJAVA}/lib/modules ]; then
+  Sys "$jimage" extract --dir modules ${TESTJAVA}/lib/modules
+  Sys "$jar" cf java-lang.jar -C modules/java.base java/lang
+  Sys rm -rf modules
+elif [ -d ${TESTJAVA}/modules ]; then
+  Sys "$jar" cf java-lang.jar -C ${TESTJAVA}/modules/java.base java/lang
+else
+  echo 'cannot create java-lang.jar' ; exit 1
+fi
 
 #----------------------------------------------------------------
 # Verify that javac class search order is the same as java's