The following two-file setup of `Prog.java` and `Helper$123.java` reading:
Prog.java
class Prog {
public static void main(String[] args) { System.out.println(Helper$123.class); }
}
Helper$123.java
class Helper$123 {}
yields:
Exception in thread "main" java.lang.NoClassDefFoundError: Helper$123
at Prog.main(Prog.java:2)
Caused by: java.lang.ClassNotFoundException: Helper$123
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at jdk.compiler/com.sun.tools.javac.launcher.MemoryClassLoader.loadClass(MemoryClassLoader.java:125)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at Prog.main(Prog.java:2)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:264)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:153)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:78)
Prog.java
class Prog {
public static void main(String[] args) { System.out.println(Helper$123.class); }
}
Helper$123.java
class Helper$123 {}
yields:
Exception in thread "main" java.lang.NoClassDefFoundError: Helper$123
at Prog.main(Prog.java:2)
Caused by: java.lang.ClassNotFoundException: Helper$123
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at jdk.compiler/com.sun.tools.javac.launcher.MemoryClassLoader.loadClass(MemoryClassLoader.java:125)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at Prog.main(Prog.java:2)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.execute(SourceLauncher.java:264)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.run(SourceLauncher.java:153)
at jdk.compiler/com.sun.tools.javac.launcher.SourceLauncher.main(SourceLauncher.java:78)
- relates to
-
JDK-8306914 Implement JEP 458: Launch Multi-File Source-Code Programs
- Resolved