Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-1067

JDK7 compile issues with OsgiCommandSupport

    Details

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

      Description

      Building with JDK7 the below error will occur when compiling OsgiCommandSupport.

      error: type ServiceReference does not take parameters

        Issue Links

          Activity

          Hide
          gawor@mcs.anl.gov Jarek Gawor added a comment -

          I just ran into this the other day. From what I know so far, the OSGi jars that Karaf complies against are compiled with -target jsr14 option which causes the Java 7 compiler to ignore (or not see) the generic information in the OSGi class files. However, Java 5 or 6 compiler is able to see that generic information. See more information on http://stackoverflow.com/questions/4058661/java-compilers-target-version-jsr14-with-jdk7-8 and the related Java bug report.

          Show
          gawor@mcs.anl.gov Jarek Gawor added a comment - I just ran into this the other day. From what I know so far, the OSGi jars that Karaf complies against are compiled with -target jsr14 option which causes the Java 7 compiler to ignore (or not see) the generic information in the OSGi class files. However, Java 5 or 6 compiler is able to see that generic information. See more information on http://stackoverflow.com/questions/4058661/java-compilers-target-version-jsr14-with-jdk7-8 and the related Java bug report.
          Hide
          gnt Guillaume Nodet added a comment -

          I think we should remove the jsr14 target if that's the problem.

          Show
          gnt Guillaume Nodet added a comment - I think we should remove the jsr14 target if that's the problem.
          Hide
          jbonofre Jean-Baptiste Onofré added a comment -

          +1

          Show
          jbonofre Jean-Baptiste Onofré added a comment - +1
          Hide
          iocanel Ioannis Canellos added a comment -

          Agree

          Show
          iocanel Ioannis Canellos added a comment - Agree
          Hide
          gnt Guillaume Nodet added a comment -

          The OSGi Alliance is aware of this issue and will take care of it for the next release, but there's no plan to upload a fixed artifact in the near term. I suppose we need to use the ones provided by Felix instead.

          Show
          gnt Guillaume Nodet added a comment - The OSGi Alliance is aware of this issue and will take care of it for the next release, but there's no plan to upload a fixed artifact in the near term. I suppose we need to use the ones provided by Felix instead.
          Hide
          gnt Guillaume Nodet added a comment -

          Looking at Felix Framework, it seems to be compiled with the jsr14 flag too, so I think the best thing is to copy the felix source files into karaf and have them compiled as part of the main module.

          Show
          gnt Guillaume Nodet added a comment - Looking at Felix Framework, it seems to be compiled with the jsr14 flag too, so I think the best thing is to copy the felix source files into karaf and have them compiled as part of the main module.
          Hide
          gnt Guillaume Nodet added a comment -

          Note that the problem is only a compile time problem and karaf runs fine on JDK 7 afaik.

          Show
          gnt Guillaume Nodet added a comment - Note that the problem is only a compile time problem and karaf runs fine on JDK 7 afaik.
          Hide
          chris@die-schneider.net Christian Schneider added a comment -

          Would it be ok to simply state that karaf has to be built with JDK 6 for some time?

          Show
          chris@die-schneider.net Christian Schneider added a comment - Would it be ok to simply state that karaf has to be built with JDK 6 for some time?

            People

            • Assignee:
              gnt Guillaume Nodet
              Reporter:
              jgoodyear Jamie goodyear
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development