2929import pascal .taie .language .natives .NativeModel ;
3030import pascal .taie .language .type .TypeSystem ;
3131
32+ import java .io .File ;
3233import java .io .IOException ;
3334import java .nio .file .Files ;
3435import java .nio .file .Path ;
@@ -62,6 +63,15 @@ protected static List<String> getClassPath(Options options) {
6263 if (options .isPrependJVM ()) {
6364 return options .getClassPath ();
6465 } else { // when prependJVM is not set, we manually specify JRE jars
66+ // check existence of JREs
67+ File jreDir = new File (JREs );
68+ if (!jreDir .exists ()) {
69+ throw new RuntimeException ("""
70+ Failed to locate Java library.
71+ Please clone submodule 'java-benchmarks' by command:
72+ git submodule update --init --recursive
73+ and put it in Tai-e's working directory.""" );
74+ }
6575 String jrePath = String .format ("%s/jre1.%d" ,
6676 JREs , options .getJavaVersion ());
6777 try (Stream <Path > paths = Files .walk (Path .of (jrePath ))) {
@@ -70,8 +80,8 @@ protected static List<String> getClassPath(Options options) {
7080 options .getClassPath ().stream ())
7181 .toList ();
7282 } catch (IOException e ) {
73- throw new RuntimeException ("Analysis on Java " + options . getJavaVersion () +
74- " is not supported yet" , e );
83+ throw new RuntimeException ("Analysis on Java " +
84+ options . getJavaVersion () + " library is not supported yet" , e );
7585 }
7686 }
7787 }
0 commit comments