Karaf
  1. Karaf
  2. KARAF-1695

startup fails on Windows with only JRE installed

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.8, 3.0.0
    • Fix Version/s: 2.3.0, 3.0.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows XP 32bit
      Oracle Java Runtime Environment 7u5

      Description

      It fails with the error:

      Error: missing `server' JVM at `C:\Program Files\Java\jre7\bin\server\jvm.dll'.
      Please install or use the JRE or JDK that contains these missing components.
      

      Possible workarounds:
      a) Install Oracle JDK
      b) modify the JAVA_OPTS:

      set JAVA_OPTS=-Xmx512M
      karaf.bat
      

      The startup-script should contain special handling for JRE on windows and fallback to "-client" of "-server" is not available.

      1. jre-windows-client.patch
        1 kB
        Christoph Gritschenberger

        Activity

        Show
        Dan Tran added a comment - initial discussion is at http://karaf.922171.n3.nabble.com/Why-is-JDK-required-for-running-Karaf-td4025391.html
        Hide
        Dan Tran added a comment -

        a fix would be scan for the existing server or client dll and act upon it for windows script

        Show
        Dan Tran added a comment - a fix would be scan for the existing server or client dll and act upon it for windows script
        Hide
        Dan Tran added a comment -

        since all jre distribution from all platforms have server mode, except windows x62 32 bit. So it is safe to remove '-server' option from

        DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote" for both unix and windows karaf(.bat) scripts

        tested with my environment

        Show
        Dan Tran added a comment - since all jre distribution from all platforms have server mode, except windows x62 32 bit. So it is safe to remove '-server' option from DEFAULT_JAVA_OPTS="-server $DEFAULT_JAVA_OPTS -Dcom.sun.management.jmxremote" for both unix and windows karaf(.bat) scripts tested with my environment
        Hide
        Christoph Gritschenberger added a comment -

        This patch make the startup-script fallback to client-mode if server-mode is not available.

        Tested under
        WinXP 32bit (German)
        and Win7 64bit (English)

        Show
        Christoph Gritschenberger added a comment - This patch make the startup-script fallback to client-mode if server-mode is not available. Tested under WinXP 32bit (German) and Win7 64bit (English)
        Hide
        Dan Tran added a comment -

        Christoph, I thought of doing the same thing, but fall back to the simpler solution by just remove '-server' option from command line. karaf java service wrapper does the same thing

        Show
        Dan Tran added a comment - Christoph, I thought of doing the same thing, but fall back to the simpler solution by just remove '-server' option from command line. karaf java service wrapper does the same thing
        Hide
        Dan Tran added a comment -

        same issue for client.bat

        Show
        Dan Tran added a comment - same issue for client.bat
        Hide
        Andreas Pieber added a comment -

        @Dan: 3.x or 2.3.x? Just given the client.bat in 2.3.x a shot and it does't look as if there's any server param.

        Show
        Andreas Pieber added a comment - @Dan: 3.x or 2.3.x? Just given the client.bat in 2.3.x a shot and it does't look as if there's any server param.
        Hide
        Andreas Pieber added a comment -

        Committed r1388128
        M assemblies/features/framework/src/main/filtered-resources/resources/bin/karaf.bat
        r1388128 = 2a67c132dbaa9c1902e7e90151a51889a0219bda (refs/remotes/origin/trunk)

        Committed r1388129
        M assemblies/apache-karaf/src/main/distribution/windows-text/bin/karaf.bat
        r1388129 = dbbffa76024f5169b11edebe9f3d1f6ef3a76da5 (refs/remotes/origin/karaf-2.3.x)

        Show
        Andreas Pieber added a comment - Committed r1388128 M assemblies/features/framework/src/main/filtered-resources/resources/bin/karaf.bat r1388128 = 2a67c132dbaa9c1902e7e90151a51889a0219bda (refs/remotes/origin/trunk) Committed r1388129 M assemblies/apache-karaf/src/main/distribution/windows-text/bin/karaf.bat r1388129 = dbbffa76024f5169b11edebe9f3d1f6ef3a76da5 (refs/remotes/origin/karaf-2.3.x)
        Hide
        Andreas Pieber added a comment -

        I neither found it on the master --> I resolve it for now; feel free to reopen if there still consist any problems

        Show
        Andreas Pieber added a comment - I neither found it on the master --> I resolve it for now; feel free to reopen if there still consist any problems

          People

          • Assignee:
            Andreas Pieber
            Reporter:
            Christoph Gritschenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development