diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelManagerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelManagerTests.java
index 65b052d..0567191 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelManagerTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaModelManagerTests.java
@@ -23,11 +23,17 @@
 import org.eclipse.jdt.internal.core.JavaElement;
 import org.eclipse.jdt.internal.core.nd.indexer.Indexer;
 
+import junit.framework.Test;
+
 public class JavaModelManagerTests extends AbstractJavaModelTests {
 
 	private static final IProgressMonitor NULL_MONITOR = new NullProgressMonitor();
 	private static final String PROJECT_NAME = JavaModelManagerTests.class.getSimpleName();
 
+	public static Test suite() {
+		return buildModelTestSuite(JavaModelManagerTests.class);
+	}
+
 	public JavaModelManagerTests(String name) {
 		super(name);
 	}
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
index 0709ad5..c3a28d0 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java
@@ -43,6 +43,7 @@
 public class ClasspathJep247Jdk12 extends ClasspathJep247 {
 
 	Map<String, IModule> modules;
+	static String MODULE_INFO = "module-info.sig"; //$NON-NLS-1$
 
 	public ClasspathJep247Jdk12(File jdkHome, String release, AccessRuleSet accessRuleSet) {
 		super(jdkHome, release, accessRuleSet);
@@ -173,9 +174,8 @@
 						public FileVisitResult visitFile(java.nio.file.Path f, BasicFileAttributes attrs) throws IOException {
 							if (attrs.isDirectory() || f.getNameCount() < 3) 
 								return FileVisitResult.CONTINUE;
-							byte[] content = null;
-							if (Files.exists(f)) {
-								content = JRTUtil.safeReadBytes(f);
+							if (f.getFileName().toString().equals(MODULE_INFO) && Files.exists(f)) {
+								byte[] content = JRTUtil.safeReadBytes(f);
 								if (content == null)
 									return FileVisitResult.CONTINUE;
 								Path m = f.subpath(1, f.getNameCount() - 1);
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
index b5142d4..85c172f 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java
@@ -32,6 +32,8 @@
 import java.util.function.Function;
 import java.util.zip.ZipFile;
 
+import javax.lang.model.SourceVersion;
+
 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.CompilationResult;
 import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies;
@@ -169,12 +171,16 @@
 
 	/** Tasks resulting from --add-reads or --add-exports command line options. */
 	Map<String,UpdatesByKind> moduleUpdates = new HashMap<>();
+	static boolean isJRE12Plus = false;
 
 	private boolean hasLimitModules = false;
 
-	static final boolean isJRE12Plus;
 	static {
-		isJRE12Plus = CompilerOptions.VERSION_12.equals(System.getProperty("java.specification.version")); //$NON-NLS-1$
+		try {
+			isJRE12Plus = SourceVersion.valueOf("RELEASE_12") != null; //$NON-NLS-1$
+		} catch(IllegalArgumentException iae) {
+			// fall back to default
+		}
 	}
 
 /*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
index d507ed1..5a3dc95 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ClasspathJrtWithReleaseOption.java
@@ -51,10 +51,13 @@
 
 public class ClasspathJrtWithReleaseOption extends ClasspathJrt {
 
+	static String MODULE_INFO = "module-info.sig"; //$NON-NLS-1$
+
 	final String release;
 	String releaseInHex;
 	private String[] subReleases;
 	private java.nio.file.FileSystem fs;
+	protected Path releasePath;
 	protected Path modulePath;
 	private String modPathString;
 	private boolean isJRE12Plus;
@@ -134,15 +137,15 @@
 				return;
 			}
 		}
-		Path releasePath = this.fs.getPath("/"); //$NON-NLS-1$
-		this.isJRE12Plus = isJRE12Plus(releasePath);
+		this.releasePath = this.fs.getPath("/"); //$NON-NLS-1$
+		this.isJRE12Plus = isJRE12Plus(this.releasePath);
 		Path modPath = this.fs.getPath(this.releaseInHex + (this.isJRE12Plus ? "" : "-modules")); //$NON-NLS-1$ //$NON-NLS-2$
 		if (Files.exists(modPath)) {
 			this.modulePath = modPath;
 			this.modPathString = this.zipFilename + "|"+ modPath.toString(); //$NON-NLS-1$
 		}
 		
-		if (!Files.exists(releasePath.resolve(this.releaseInHex))) {
+		if (!Files.exists(this.releasePath.resolve(this.releaseInHex))) {
 			Exception e = new IllegalArgumentException("release " + this.release + " is not found in the system"); //$NON-NLS-1$//$NON-NLS-2$
 			throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, e.getMessage(), e));
 		}
@@ -152,7 +155,7 @@
 		}
 		if (this.release != null) {
 			List<String> sub = new ArrayList<>();
-			try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(releasePath)) {
+			try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(this.releasePath)) {
 				for (final java.nio.file.Path subdir : stream) {
 					String rel = JRTUtil.sanitizedFileName(subdir);
 					if (rel.contains(this.releaseInHex)) {
@@ -226,10 +229,12 @@
 			return;
 		Set<IModule> cache = ModulesCache.get(jrt.modPathString);
 		if (cache == null) {
-			try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(jrt.modulePath)) {
+			try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(jrt.releasePath)) {
 				for (final java.nio.file.Path subdir : stream) {
-
-					Files.walkFileTree(subdir, Collections.EMPTY_SET, 1, new FileVisitor<java.nio.file.Path>() {
+					if (!subdir.getFileName().toString().contains(jrt.releaseInHex)) {
+						continue;
+					}
+					Files.walkFileTree(subdir, Collections.EMPTY_SET, 2, new FileVisitor<java.nio.file.Path>() {
 						@Override
 						public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs)
 								throws IOException {
@@ -239,14 +244,16 @@
 						@Override
 						public FileVisitResult visitFile(java.nio.file.Path f, BasicFileAttributes attrs)
 								throws IOException {
-							byte[] content = null;
-							if (Files.exists(f)) {
-								content = JRTUtil.safeReadBytes(f);
+							if (attrs.isDirectory() || f.getNameCount() < 3) {
+								return FileVisitResult.CONTINUE;
+							}
+							if (f.getFileName().toString().equals(MODULE_INFO)) {
+								byte[] content = JRTUtil.safeReadBytes(f);
 								if (content == null)
 									return FileVisitResult.CONTINUE;
 								jrt.acceptModule(content);
 							}
-							return FileVisitResult.CONTINUE;
+							return FileVisitResult.SKIP_SIBLINGS;
 						}
 
 						@Override
