Karaf
  1. Karaf
  2. KARAF-1116

Scripts fail at resolving java jdk.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.4
    • Fix Version/s: 2.2.6, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None
    • Environment:

      Windows 7 x64

      Description

      Scripts like karaf.bat have a problem resolving the java jdk under windows, when the variables are setup this way:
      JAVA_HOME = F:\Java\jdk
      JAVA = %JAVA_HOME%\bin
      Path = various stuff; %JAVA%

      echo %PATH%
      results in the correct output of: F:\Java\jdk\bin

      If the JAVA variable is deleted and the Path is set to %JAVA_HOME%\bin it does work, although the resulting path is the same.

        Activity

        Hide
        Andreas Pieber added a comment -

        OK, the problem is not what you do it self, but rather that the Karaf scripts define %JAVA% as the executable. Since you define JAVA as the path to %JAVA_HOME%\bin this (logically with this additional information) fails. Well, we've the following possibilities now:

        1. close this as wont fix and assume that ppl dont define JAVA as %JAVA_HOME%\bin or something else ambitious
        2. probe if %JAVA% is an executable and otherwise go the "regular way" using $JAVA_HOME%\bin\java

        TBH I'm a little bit in favor of option 1; but I'm open for other opinions

        Show
        Andreas Pieber added a comment - OK, the problem is not what you do it self, but rather that the Karaf scripts define %JAVA% as the executable. Since you define JAVA as the path to %JAVA_HOME%\bin this (logically with this additional information) fails. Well, we've the following possibilities now: close this as wont fix and assume that ppl dont define JAVA as %JAVA_HOME%\bin or something else ambitious probe if %JAVA% is an executable and otherwise go the "regular way" using $JAVA_HOME%\bin\java TBH I'm a little bit in favor of option 1; but I'm open for other opinions
        Hide
        Jean-Baptiste Onofré added a comment -

        IMHO, the karaf.bat script is correct. It's an user "mistake" to define a directory in the JAVA variable.

        The JAVA_HOME variable contains a directory (which is correct), but JAVA variable must contain an executable.

        Show
        Jean-Baptiste Onofré added a comment - IMHO, the karaf.bat script is correct. It's an user "mistake" to define a directory in the JAVA variable. The JAVA_HOME variable contains a directory (which is correct), but JAVA variable must contain an executable.
        Hide
        Achim Nierbeck added a comment -

        well maybe it's possible to test if JAVA is a executable, and fail if not

        Show
        Achim Nierbeck added a comment - well maybe it's possible to test if JAVA is a executable, and fail if not
        Hide
        Jean-Baptiste Onofré added a comment -

        It's what I did in ServiceMix 3 startup script.

        Easy to do.

        Show
        Jean-Baptiste Onofré added a comment - It's what I did in ServiceMix 3 startup script. Easy to do.
        Hide
        Jean-Baptiste Onofré added a comment -

        I prefer to postpone to 2.2.6, in order to focus on others "major" issues.

        Show
        Jean-Baptiste Onofré added a comment - I prefer to postpone to 2.2.6, in order to focus on others "major" issues.
        Hide
        Jean-Baptiste Onofré added a comment -

        Agree with Andreas, users have to define the JAVA variable correctly. As the "default" behavior of the Karaf script is correct, I consider it's not a Karaf bug.

        Show
        Jean-Baptiste Onofré added a comment - Agree with Andreas, users have to define the JAVA variable correctly. As the "default" behavior of the Karaf script is correct, I consider it's not a Karaf bug.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Lukas Stampf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development