Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-320

"mvn test" fails with COMPILATION ERROR in SynchronizedArithmetic.java on Java 11

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.2
    • None
    • JDK: OpenJDK 11 (hotspot)

      OS: Ubuntu 18.04.3 LTS

      Apache Maven 3.3.9

    Description

      Running "mvn test" when using OpenJDK's Java 11 fails with the following errors:

      [WARNING] COMPILATION WARNING : 
      [INFO] -------------------------------------------------------------
      [WARNING] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[24,16] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
      [WARNING] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[97,20] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
      [WARNING] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[100,23] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
      [WARNING] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[102,23] sun.misc.Unsafe is internal proprietary API and may be removed in a future release
      [INFO] 4 warnings 
      [INFO] -------------------------------------------------------------
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[63,19] cannot find symbol
        symbol:   method monitorEnter(java.lang.Object)
        location: variable UNSAFE of type sun.misc.Unsafe
      [ERROR] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[72,19] cannot find symbol
        symbol:   method monitorExit(java.lang.Object)
        location: variable UNSAFE of type sun.misc.Unsafe
      [ERROR] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[113,19] cannot find symbol
        symbol:   method monitorEnter(java.lang.Object)
        location: variable UNSAFE of type sun.misc.Unsafe
      [ERROR] /local_static/github/commons-jexl/src/test/java/org/apache/commons/jexl3/SynchronizedArithmetic.java:[118,19] cannot find symbol
        symbol:   method monitorExit(java.lang.Object)
        location: variable UNSAFE of type sun.misc.Unsafe
      

      BUILDING.txt states that JEXL "requires Java 6 (or later)".  I assume that you expect "mvn test" to work with Java 11.  If not, then this is really a doc bug in BUILDING.txt–it should say that it "requires Java 6 (exactly)" or include the range of supported Java versions.

       

      Impact

      This is a small barrier to entry for a new contributor.  There is an obvious and straight-forward way to get past the problem, which is to download a compatible version of Java and set JAVA_HOME accordingly.  I used Java 1.8, which already had installed on my dev machine.  This prints the same warnings, but no errors.

       

      Attachments

        Activity

          People

            henrib Henri Biestro
            david_costanzo David Costanzo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: