On Fri, 2006-05-05 at 14:20 -0700, Sean McNamara wrote:
> I'm having a VERY odd compilation problem and am at a loss for why it would 
> occur.  We're in the process of moving from Maven v1.1 to Maven 2.  We ported 
> the project.xml files over to pom.xml, and succeeded in getting the build 
> going.  Unfortunately, the new archive was failing to run.
> 
> After chasing my tail for the last week, I took a look at the classfiles that 
> were giving us a problem in a hex editor, and see that the actual classfiles 
> differ in terms of the major and minor numbers in the classfile.
> 
> I only have a single JVM installed on this machine, so I'm pretty confident 
> the same one is being used in both compiles.
> 
> Does anyone have the slightest idea how this might be possible?

Java compilers are capable of generating output in older formats.

In m2, I think the maven-compiler-plugin defaults to 
  -target 1.3
ie generates output in a format compatible with 1.3 JVMs. Different
-target options will indeed cause different major/minor numbers in the
generated .class files.

Try setting source/target to your desired values, using the syntax in
the compiler plugin docs:
  http://maven.apache.org/plugins/maven-compiler-plugin/howto.html

I don't understand why the output would "fail to run", though, as the
output cannot be newer than the JDK version you've got installed and you
say you have only one JDK on your machine.

Cheers,

Simon


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

Reply via email to