diff --git a/generators/org/jetbrains/jet/generators/mockJDK/GenerateMockJdk.java b/generators/org/jetbrains/jet/generators/mockJDK/GenerateMockJdk.java index cc7ae3a40db..3165f412676 100644 --- a/generators/org/jetbrains/jet/generators/mockJDK/GenerateMockJdk.java +++ b/generators/org/jetbrains/jet/generators/mockJDK/GenerateMockJdk.java @@ -337,6 +337,9 @@ public class GenerateMockJdk { private static void generateFilteredJar(File source, File target, Set entryNamesToInclude, boolean assertAllFound) throws IOException { + if (!source.exists()) { + throw new AssertionError(source + " doesn't exist"); + } JarFile sourceJar = new JarFile(source); JarOutputStream targetJar = new JarOutputStream(new FileOutputStream(target)); @@ -382,8 +385,14 @@ public class GenerateMockJdk { } public static void main(String[] args) throws IOException { - File rtJar = new File(""); - File srcJar = new File("/src.jar"); + String rtJarPath = System.getProperty("rt.jar"); + String srcZipPath = System.getProperty("src.zip"); + if (rtJarPath == null || srcZipPath == null) { + throw new AssertionError("Provide path to rt.jar and src.zip in VM options: \"-Drt.jar=... -Dsrc.zip=...\""); + } + + File rtJar = new File(rtJarPath); + File srcJar = new File(srcZipPath); generateFilteredJar( rtJar, @@ -396,4 +405,7 @@ public class GenerateMockJdk { getSourceFileEntries(), false); } + + private GenerateMockJdk() { + } }