mirror of
https://github.com/FranzHaidnor/haidnorJVM.git
synced 2026-03-13 21:43:42 +08:00
update ClassLoader
This commit is contained in:
@@ -46,7 +46,6 @@ public class ClassLoader {
|
||||
public Klass loadClass(String classPath) throws IOException {
|
||||
ClassParser classParser;
|
||||
if (classPath.startsWith("java/")) {
|
||||
String rtJarPath = getRtJarPath();
|
||||
|
||||
if (!new File(rtJarPath).exists()) {
|
||||
throw new IllegalStateException("rt.jar not found");
|
||||
@@ -72,11 +71,4 @@ public class ClassLoader {
|
||||
return klass;
|
||||
}
|
||||
|
||||
private String getRtJarPath() {
|
||||
// String javaHome = System.getenv("JAVA_HOME");
|
||||
// Path rtJarPath = Paths.get(javaHome, "jre", "lib", "rt.jar");
|
||||
return rtJarPath;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ public class Demo4 {
|
||||
public static void main(String[] args) {
|
||||
Student student = new Student();
|
||||
student.eat();
|
||||
new Thread(() -> {}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user