You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Mark Derricutt <ma...@talios.com> on 2011/11/22 00:48:49 UTC

Using maven-scr-plugin under OpenJDK 1.7

Has anyone got maven-scr-plugin working under OpenJDK 1.7 at all?

[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr
(generate-scr-scrdescriptor) on project smx3.entity: Execution
generate-scr-scrdescriptor of goal
org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompatibility
was encountered while executing
org.apache.felix:maven-scr-plugin:1.7.4:scr:
java.lang.UnsupportedClassVersionError: smx3/api/EntityProvider :
Unsupported major.minor version 51.0

I see to recall seeing somewhere the other day someone mentioning something
about changes in how major.minor's are compiled/stored/checked or something
( the specifics escape me ) and I'm not sure if that was on this list, or
elsewhere.

When looking at the classes with javap they're 51.0:

Classfile
/Users/amrk/IdeaProjects/securemx/git/smx3-core/smx3.schema/target/classes/smx3/schema/Agreement.class
  Last modified 22/11/2011; size 13071 bytes
  MD5 checksum 3c69b291e4bebd5f3926b9ba88209bf1
  Compiled from "Agreement.java"
public class smx3.schema.Agreement extends java.lang.Object implements
smx3.schema.Identity<java.lang.Integer>, smx3.schema.Expirable
  Signature: #318                         //
Ljava/lang/Object;Lsmx3/schema/Identity<Ljava/lang/Integer;>;Lsmx3/schema/Expirable;
  SourceFile: "Agreement.java"
  RuntimeVisibleAnnotations:
    0: #321()
    1: #322(#323=s#324,#141=s#207)
    2: #325()
    3: #238(#239=e#240.#241)
  InnerClasses:
       public #102= #41 of #13; //AgreementBillTo=class
smx3/schema/Agreement$AgreementBillTo of class smx3/schema/Agreement
  minor version: 0
  major version: 51
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:


Any ideas?


-- 
"Great artists are extremely selfish and arrogant things" — Steven Wilson,
Porcupine Tree

Re: Using maven-scr-plugin under OpenJDK 1.7

Posted by Mark Derricutt <ma...@talios.com>.
Neil,

I read this on my phone earlier and immediately slapped myself in the
forehead :)  You're 100% correct, there are multiple JVMs involved.

I'm using the maven toolchain plugin to tell the maven compiler plugin to
use OpenJDK 1.7 for compilation, even tho 1.6 is the JVM actually running
-maven- itself.  I'll grab the sources for both plugins and write up a
patch to use the toolchain plugin if its configured and use the appropriate
JVM ( if possible ).

I'll need to sign and send in an Apache Contrib License form first tho.

At the moment I'm not really wanting to make JDK 7 the primary ( yay OSX! )
as this is just a spike branch, there may be another way of structuring the
build so I might also look at that.

Mark

-- 
"Great artists are extremely selfish and arrogant things" — Steven Wilson,
Porcupine Tree

On Tue, Nov 22, 2011 at 1:54 PM, Neil Bartlett <nj...@gmail.com> wrote:

>  Do you have other Java versions installed on the same machine, and is
> it possible that Maven has picked up one of the other ones?
>
> Also, did you compile the Maven SCR plugin locally? It would be
> surprising to me if the binaries for the plugin are being shipped with
> class version 51.0, implying they can only run on Java 7.
>

Re: Using maven-scr-plugin under OpenJDK 1.7

Posted by Neil Bartlett <nj...@gmail.com>.
Mark,

That's a slightly strange error. 51.0 is the class version associated
with Java 7, so it seems to indicate that the
"smx3.api.EntityProvider" class was compiled with javac 7 but you are
not actually running it on Java 7.

Do you have other Java versions installed on the same machine, and is
it possible that Maven has picked up one of the other ones?

Also, did you compile the Maven SCR plugin locally? It would be
surprising to me if the binaries for the plugin are being shipped with
class version 51.0, implying they can only run on Java 7.

Regards,
Neil

On Mon, Nov 21, 2011 at 11:48 PM, Mark Derricutt <ma...@talios.com> wrote:
> Has anyone got maven-scr-plugin working under OpenJDK 1.7 at all?
>
> [ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.4:scr
> (generate-scr-scrdescriptor) on project smx3.entity: Execution
> generate-scr-scrdescriptor of goal
> org.apache.felix:maven-scr-plugin:1.7.4:scr failed: An API incompatibility
> was encountered while executing
> org.apache.felix:maven-scr-plugin:1.7.4:scr:
> java.lang.UnsupportedClassVersionError: smx3/api/EntityProvider :
> Unsupported major.minor version 51.0
>
> I see to recall seeing somewhere the other day someone mentioning something
> about changes in how major.minor's are compiled/stored/checked or something
> ( the specifics escape me ) and I'm not sure if that was on this list, or
> elsewhere.
>
> When looking at the classes with javap they're 51.0:
>
> Classfile
> /Users/amrk/IdeaProjects/securemx/git/smx3-core/smx3.schema/target/classes/smx3/schema/Agreement.class
>  Last modified 22/11/2011; size 13071 bytes
>  MD5 checksum 3c69b291e4bebd5f3926b9ba88209bf1
>  Compiled from "Agreement.java"
> public class smx3.schema.Agreement extends java.lang.Object implements
> smx3.schema.Identity<java.lang.Integer>, smx3.schema.Expirable
>  Signature: #318                         //
> Ljava/lang/Object;Lsmx3/schema/Identity<Ljava/lang/Integer;>;Lsmx3/schema/Expirable;
>  SourceFile: "Agreement.java"
>  RuntimeVisibleAnnotations:
>    0: #321()
>    1: #322(#323=s#324,#141=s#207)
>    2: #325()
>    3: #238(#239=e#240.#241)
>  InnerClasses:
>       public #102= #41 of #13; //AgreementBillTo=class
> smx3/schema/Agreement$AgreementBillTo of class smx3/schema/Agreement
>  minor version: 0
>  major version: 51
>  flags: ACC_PUBLIC, ACC_SUPER
> Constant pool:
>
>
> Any ideas?
>
>
> --
> "Great artists are extremely selfish and arrogant things" — Steven Wilson,
> Porcupine Tree
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org