[ http://jira.codehaus.org/browse/SUREFIRE-43?page=all ]
Adam Hardy closed SUREFIRE-43:
------------------------------
Resolution: Fixed
Fix Version: 2.0
I downgraded the target to jdk 1.4 and this then worked on Windows. However it
did not work on Unix, so I examined the differences in the environments and
discovered that I had an Oracle JRE on the PATH in both environments.
This 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.
I must apologise for suspecting that one of the Maven committers was compiling
with JDK 1.6-beta.
> UnsupportedClassVersionError with jdk1.5.0_06 and source and target = 1.5
> -------------------------------------------------------------------------
>
> Key: SUREFIRE-43
> URL: http://jira.codehaus.org/browse/SUREFIRE-43
> Project: surefire
> Type: Bug
> Versions: 2.0
> Environment: linux and windows
> Reporter: Adam Hardy
> Fix For: 2.0
> Attachments: maven-surefire.log
>
>
> 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(IsolatedClassLoader.java:88)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirect...
> at
> org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java: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(SurefireBooter.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 as follows:
> maven-surefire-plugin
> 2.2-20060507.223157-4
> surefire (surefire-booter, surefire-api, surefire-junit and
> surefire-providers)
> 2.0-20060507.230910-3
> Marco on the user mailing list kindly established that this project works for
> him. I have tested
> this on unix and windows. So this is turning into a major detective story.
> My next step is to try to run it with those versions, and if that
> doesn't work, to compile from source.
> Hopefully there is help available on the mailing list or as a result of this
> new jira issue, and perhaps if I get nowhere, I may contact the developers
> mentioned in the poms.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira