Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3655

NB-Javac linkage error with JDK 14, can't generate class file version 58.65535

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 11.2
    • None
    • None

    Description

      Using NB 11.2 on macos 10.15.2 and am using JEP 354: Switch Expressions so am compiling with JDK 14.

      openjdk 14-ea 2020-03-17
      OpenJDK Runtime Environment (build 14-ea+29-1384)
      OpenJDK 64-Bit Server VM (build 14-ea+29-1384, mixed mode, sharing)
      

       
      Am also setting these additional compiler options in the NB project:

      --enable-preview --source 14 -Xlint:unchecked -Xlint:preview
      

      Installed nb-javac today to see if I could get "Compile on save" working.

      With "Compile on save" disabled I need to manually build the project every time I want to test changes.

      With "Compile on save" enabled I get this error when running the project.

      Error: LinkageError occurred while loading main class GraphPanel.GraphDemo
      	java.lang.UnsupportedClassVersionError: GraphPanel/GraphDemo (class file version 57.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 58.65535
      /Users/stephen/Library/Caches/NetBeans/11.2/executor-snippets/run.xml:111: The following error occurred while executing this line:
      /Users/stephen/Library/Caches/NetBeans/11.2/executor-snippets/run.xml:68: Java returned: 1
      BUILD FAILED (total time: 0 seconds)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            stepheneb Stephen Bannasch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: