I had an Oracle JRE 1.3 on the PATH which was causing the issue -
Sherlock Holmes would have deduced that earlier, since I have the latest
JDK but an UnsupportedClassVersionError means I was not using the
latest, so there had to be another java on my path.

Mea culpa. 

Thanks for the help, especially Marco. 

Adam

-----Original Message-----
From: Adam Hardy 
Sent: 24 May 2006 10:52
To: 'Maven Users List'
Subject: RE: Surefire-2.2-SNAPSHOT and UnsupportedClassVersionError -
more info

When I run 'mvn test', I get a stacktrace from the surefire-booter
saying UnsupportedClassVersionError as follows.  This is a recap of my
minimal project which I'm going to use as the base for a bug in jira.

[INFO] Surefire report directory:
C:\Projects\cortex\back-end\target\surefire-reports
org.apache.maven.surefire.booter.SurefireExecutionException:
com/cortex/base/domain/card/CardFinderTest (Unsupported major.minor
version 49.0); 
nested except is java.lang.UnsupportedClassVersionError: 
com/cortex/base/domain/card/CardFinderTest (Unsupported major.minor
version 49.0)
java.lang.UnsupportedClassVersionError:
com/cortex/base/domain/card/CardFinderTest 
(Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at
org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedC
lassLoader.java:88)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSet
s(AbstractDirect...
        at
org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.ja
va:147)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Suref
ireBooter.java:220)
        at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
:733)

I have JDK1.5.0_06 as my JAVA_HOME and this is the compiler plugin
config:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

I started with clean code base, checked for stray .class files, and the
local repository is empty. I specified the following for my remote
repositories:

   <pluginRepositories>
      <pluginRepository>
         <id>apache.snapshots</id>
         <url>http://cvs.apache.org/maven-snapshot-repository</url>
      </pluginRepository>
   </pluginRepositories>
   <repositories>
      <repository>
           <id>apache.snapshots</id>
           <url>http://cvs.apache.org/maven-snapshot-repository</url>
         </repository>
   </repositories>

I specified the latest maven-surefire-plugin-2.2-SNAPSHOT

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.2-SNAPSHOT</version>
      </plugin>

And I can see the maven downloads the snapshots for
maven-surefire-plugin-2.2 (<version>2.2-20060507.223157-4</version>) and
surefire-2.0. It is using   <version>2.0-20060507.230910-3</version> for
surefire-booter, surefire-api, surefire-junit and surefire-providers.

I have an associate (Marco) for whom this set-up works, so I assume that
he has earlier versions of the jars. 

My next step is to try to run it with those versions, and if that
doesn't work, to compile from source. 

Failing that, and if there is no more help available on the list or as a
result of this new jira issue, I may have to contact the developers
mentioned in the poms. 

Thanks
Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to