• Resolved Joshua

    (@s001911)


    Hi,

    I’m getting the following errors in the JS Compression. The CSS compression seems to be working fine though.

    2018-02-05T00:19:19+00:00 - MERGED:
     - jquery-core - /wp-includes/js/jquery/jquery.js
     - jquery-migrate - /wp-includes/js/jquery/jquery-migrate.min.js - unminified version used
    2018-02-05T00:19:22+00:00 - COMPRESSING JS WITH CLOSURE
    2018-02-05T00:19:22+00:00 - COMPRESSION FAILED
    array(14) {
      [0]=>
      string(152) "Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 52.0"
      [1]=>
      string(53) "	at java.lang.ClassLoader.defineClass1(Native Method)"
      [2]=>
      string(59) "	at java.lang.ClassLoader.defineClass(ClassLoader.java:803)"
      [3]=>
      string(75) "	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)"
      [4]=>
      string(64) "	at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)"
      [5]=>
      string(62) "	at java.net.URLClassLoader.access$100(URLClassLoader.java:64)"
      [6]=>
      string(58) "	at java.net.URLClassLoader$1.run(URLClassLoader.java:354)"
      [7]=>
      string(58) "	at java.net.URLClassLoader$1.run(URLClassLoader.java:348)"
      [8]=>
      string(62) "	at java.security.AccessController.doPrivileged(Native Method)"
      [9]=>
      string(62) "	at java.net.URLClassLoader.findClass(URLClassLoader.java:347)"
      [10]=>
      string(57) "	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)"
      [11]=>
      string(65) "	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)"
      [12]=>
      string(57) "	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)"
      [13]=>
      string(73) "	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)"
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • I was just looking into this issue on my websites with this plugin. I’m on a VPS on Dreamhost (but realistically, it’s just a shared server so I have no control). This error seems to be referring to the version of Java on the server. So it would appear that Closure Compiler is requiring a newer version of Java than is available.

    Since this error is new and I wasn’t getting it last time I checked (months ago), I checked the Changelog for MMR.

    Update Closure to latest is listed for both 1.8.8 and 1.8.7 versions. I went to the 1.8.7 version of the trunk first and grabbed that version of closure-compiler.jar and replaced it in my plugin on the server. All fixed!

    Obviously, this isn’t an ideal, future-proof solution. And you may need to go back to an even older version of the compiler file for your server configuration. But at least we know what the error is and what can be done for a temporary fix.

    I’m sure my server will get updated eventually, but that could easily be in years, not months. So I guess it’s something to consider when pushing updates to the plugin for WordPress sites which are very frequently hosted on shared servers. Big props to the developer of this plugin for allowing a graceful fallback if this happens to occur (though the red error text was a little alarming, haha).

    Plugin Author launchinteractive

    (@launchinteractive)

    Thanks for investigating this Andrew. Perhaps we should add a setting so you can select what version of closure you want to use. What do you think? It would mean bundling multiple versions.

    I’m really not sure. As much as I hate adding weight to any project (and the closure jar file is very big) this is a big issue that is probably affecting a huge percentage of your users right now.

    I’m guessing the best option objectively is to default to an older, stable version and never update it. Then offer the newest version as an option with a note about checking to see if it falls.

    Unless you can automatically switch between versions after checking the installed Java version. Then you should totally do that and never give the user a choice.

    Plugin Author launchinteractive

    (@launchinteractive)

    Hi Andrew,

    I simply haven’t had enough time to experiment with this. I might resolve it for now. If there are more users that start having this issue then we can look at it again.

    Considering you’re busy, I think it’s totally reasonable to leave this alone until you know it’s affecting a larger userbase. I would assume that it’s affecting a large portion of people who simply aren’t checking the plugin for the failure messages though. So my suggestion would be NOT to update Closure again unless you absolutely have to. That way this issue doesn’t surface again in the future.

    Hello,

    I’ve got similar issue:

    2018-10-29T12:07:14+00:00 - COMPRESSING JS WITH CLOSURE
    2018-10-29T12:07:14+00:00 - COMPRESSION FAILED
    array(14) {
      [0]=>
      string(152) "Exception in thread "main" java.lang.UnsupportedClassVersionError: com/google/javascript/jscomp/CommandLineRunner : Unsupported major.minor version 52.0"
      [1]=>
      string(53) "	at java.lang.ClassLoader.defineClass1(Native Method)"
      [2]=>
      string(59) "	at java.lang.ClassLoader.defineClass(ClassLoader.java:808)"
      [3]=>
      string(75) "	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)"
      [4]=>
      string(64) "	at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)"
      [5]=>
      string(62) "	at java.net.URLClassLoader.access$100(URLClassLoader.java:64)"
      [6]=>
      string(58) "	at java.net.URLClassLoader$1.run(URLClassLoader.java:354)"
      [7]=>
      string(58) "	at java.net.URLClassLoader$1.run(URLClassLoader.java:348)"
      [8]=>
      string(62) "	at java.security.AccessController.doPrivileged(Native Method)"
      [9]=>
      string(62) "	at java.net.URLClassLoader.findClass(URLClassLoader.java:347)"
      [10]=>
      string(57) "	at java.lang.ClassLoader.loadClass(ClassLoader.java:430)"
      [11]=>
      string(65) "	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:323)"
      [12]=>
      string(57) "	at java.lang.ClassLoader.loadClass(ClassLoader.java:363)"
      [13]=>
      string(73) "	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)"
    }

    I’ve updated my Java to 1.8.0 and this resolved the problem.

    Thanks

    • This reply was modified 6 years, 1 month ago by willfre.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Unsupported major.minor version 52.0’ is closed to new replies.