Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2303

performance.py does not use JAVA_HOME

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.5.2
    • Fix Version/s: 4.6.0
    • Component/s: None
    • Labels:
      None

      Description

      Was testing Phoenix support in one of my projects when I hit this issue with performance.py (cut & pasting for people web searching).

      Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/phoenix/util/PhoenixRuntime : Unsupported major.minor version 51.0
      	  at java.lang.ClassLoader.defineClass1(Native Method)
      	  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
      	  at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      	  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      	  at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      	  at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      	  at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      	  at java.security.AccessController.doPrivileged(Native Method)
      	  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      	  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      Could not find the main class: org.apache.phoenix.util.PhoenixRuntime.  Program will exit.
      

      This is of course the common error indicating that you are using an older version of java to run something compiled with a newer version. But I was setting JAVA_HOME to an appropriate Java 1.7 path.

      I eventually realized the issue was performance.py wasn't honoring the environment variable JAVA_HOME and picking up an older java version sitting in /usr/bin, where as queryserver.py does honor JAVA_HOME.

      I can / will produce a patch, but can't right now. Thought I'd post this bug today for people web searching and in case someone else wants to beat me to it.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chu11 Albert Chu
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: