Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8323815

Source launcher should find classes with $ in names

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • 22, 23
    • tools
    • None
    • b07
    • generic
    • generic

      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)

            cstein Christian Stein
            cstein Christian Stein
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: