I have two files: A.java and B.java

/*
 * @test
 * @build A B
 * @run main A
 */
public class A {
    public static void main(String[] args) throws Exception {
Class.forName("B", true, Thread.currentThread().getContextClassLoader());
    }
}

public class B {
}

Now jtreg A.java shows:

   java.lang.ClassNotFoundException: B

How can I get B visible in A's ContextClassLoader?

Don't tell me to change to Class.forName("B"), that line is copied from JDK that is called by a real test.

Or, the JDK code itself is problematic and it should fallback to another ClassLoader?

Thanks
Max

Reply via email to