Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-2049

Installer checks for "javac" multiple times, once incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 2.4.0, 2.3.0.patch
    • grouperInstaller
    • None

    Description

      The Grouper installer has two different ways of checking for valid java and javac executables, and one of them causes problems during my install. I have JAVA_HOME set to the jdk, but if I do an install using the jre java, I get error "This needs to be run from a jdk, but it is detected to be running from a JRE... run the installed from a JDK!". The installer shouldn't need to be run from the jdk, it should just check whether javac can be found somewhere.

      The first check is when the program starts, before the first prompt. It calls method validJava(), which does the following checks:

      • property java.version >= 1.7
      • System.getenv("JAVA_HOME") is set
      • $JAVA_HOME/bin/java -version shows version a.b.c and version >= 1.7
      • $JAVA_HOME/bin/javac -version shows version a.b.c. and version >= 1.7
      • "java -version" shows a.b.c and version >= 1.7
      • "javac -version" shows a.b.c and version >= 1.7

      These all work successfully (Oracle jdk 1.8).

      After choosing action "install", the installer follows the mainInstallLogic() method. Here it first asks for hsqldb information, then calls validJavaVersion(), which follows different logic from validJava():

      • System.getProperty("java.home") + /bin/java -version shows version a.b.c_d and version >= 1.6
      • The above java path, plus "c -version" (i.e. ...bin/java*c* -version) shows version a.b.c_d and version >= 1.6

      A few problems here:

      1) getProperty("java.home") is for the jre, and getenv("JAVA_HOME") is for the jdk. In my case, java.home is the jre java
      2) The installer has already checked JAVA_HOME before the first prompt, so there is no need to check it again
      3) The first check is for Java 1.7+, the second is for 1.6+
      4) It shouldn't be necessary to run the installer from the jdk, as long as javac can be found in the path
      5) If a second check is really needed, it should happen before all the hsql prompts so it can fail earlier

      Possibly introduced with GRP-1425: admin task in grouperInstaller to help with log management .

      Attachments

        Issue Links

          Activity

            People

              chad.redman@at.internet2.edu Chad Redman (unc.edu)
              chad.redman@at.internet2.edu Chad Redman (unc.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: