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

Compiler should gracefully exit when core packages are missing in installation

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :
      javac 1.8.0_112

      ADDITIONAL OS VERSION INFORMATION :
      OSX 10.11.6
      uname -a = Darwin sch-bp-2157.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Sep 1 15:01:16 PDT 2016; root:xnu-3248.60.11~2/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      The java compiler crashes when doing:

      javac -source 8 -target 8 -bootclasspath android.jar Bug.java

       * android.jar comes from Android SDK 23 (platforms/android-23/android.jar)
       * Bug.java contains the code in the Source Code field.

      Notes:

       * If I avoid using lambda, javac does not crash.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Successful compile (or graceful error).

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An exception has occurred in the compiler (1.8.0_112). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
      com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Bug {
          public static void doStuff(Runnable runnable) {
              runnable.run();
          }

          public static void main(String[] args) {
              doStuff(() -> {
                  System.out.println("Hello World");
              });
          }
      }

      ---------- END SOURCE ----------

            vromero Vicente Arturo Romero Zaldivar
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: