You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Piotr Skawinski <p_...@hotmail.com> on 2007/05/31 17:39:27 UTC

UnsupportedClassVersionError on unit test using java 1.5

Hi,I'm using java 1.4 for general build (and so my JAVA_HOME points to the jdk 1.4). But one subproject is build with java 1.5 and this is specified in its pom.xml file:<plugin>        <groupId>org.apache.maven.plugins</groupId>        <artifactId>maven-compiler-plugin</artifactId>        <configuration>            <verbose>true</verbose>            <fork>true</fork>            <executable>C:\Program Files\Java\jdk1.5.0_06\bin\javac</executable>            <compilerVersion>1.5</compilerVersion>            <source>1.5</source>            <target>1.5</target>        </configuration>      </plugin>When I run my unit test I get UnsupportedClassVersionError with follwing stack trace:----------------------------------------------------------------------------------------------------[INFO] Surefire report directory: F:\CC_Work\isk_SI-Main\si-serviceinfrastructure\cb-mob-proj\si-to-mainframe-bean\target\surefire-reportsorg.apache.maven.surefire.booter.SurefireExecutionException: dk/pfa/si/adapter/bs2000/bc/BS2000IsDownTest (Unsupported major.minor version 49.0); nested exception is java.lang.UnsupportedClassVersionError: dk/pfa/si/adapter/bs2000/bc/BS2000IsDownTest (Unsupported major.minor version 49.0)java.lang.UnsupportedClassVersionError: dk/pfa/si/adapter/bs2000/bc/BS2000IsDownTest (Unsupported major.minor version 49.0)        at java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;(Unknown Source)        at java.security.SecureClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/CodeSource;)Ljava/lang/Class;(SecureClassLoader.java:123)        at java.net.URLClassLoader.defineClass(Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:251)        at java.net.URLClassLoader.access$100(Ljava/net/URLClassLoader;Ljava/lang/String;Lsun/misc/Resource;)Ljava/lang/Class;(URLClassLoader.java:55)        at java.net.URLClassLoader$1.run()Ljava/lang/Object;(URLClassLoader.java:194)        at jrockit.vm.AccessController.do_privileged_exc(Ljava/security/Privileg----------------------------------------------------------------------------------------------------This is somehow also understandable, as I expect that unit test is executed by jdk
1.4 while the class file is compiled with jdk 1.5. Is it possible to
specify in the pom.xml that unit test should also be executed by jdk 1.5 even though
my JAVA_HOME points to jdk 1.4??



Any help will be appreciated.Best regards, Piotr


_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE

Re: UnsupportedClassVersionError on unit test using java 1.5

Posted by Wendy Smoak <ws...@gmail.com>.
On 5/31/07, Piotr Skawinski <p_...@hotmail.com> wrote:

> Is it possible to specify in the pom.xml that unit test should also be executed by jdk
> 1.5 even though my JAVA_HOME points to jdk 1.4??

This might help...
http://docs.codehaus.org/display/MAVENUSER/Compile+and+Test+with+Different+JDK+Versions

-- 
Wendy

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