Skip to content

February 7, 2009

3

Compiler Wierdness

I was playing around with the Spring/ExtJS Template on my Ubuntu box and ran into a strange problem. On the Vista laptop, if I compile with IntelliJ or from the command line with Ant, the application works perfectly fine when I deploy it to Tomcat. On the Ubuntu box, the WAR file generated by IntelliJ worked fine, but the WAR file output of the Ant script puked and died.

It took about an hour of hair pulling to figure out what the problem is. In the original build.xml file, the compile task looked like this:

Notice I didn’t specify and of the compiler, source or debug options. On Sun’s JDK 1.6.0_12 for Windows, debug appears to be the default. The Spring annotation needs the debug information for mapping parameter names in views.

On Linux, the same JDK (Sun 1.6.0_12) behaves differently. It does not include the debug information by default. In order to make my Ant build file work, I changed the compile attributes to this:

Explicitly defining debug=”true” resolved the issue. This is the first time I’ve bumped in to a basic behavioral difference for Java across operating systems. The lesson learned is play it safe and always specify compiler values.

Read more from Programming
3 Comments Post a comment
  1. Feb 11 2009

    Hmm… I wonder if your problem is related to how you setup Java on Ubuntu. Have you tried on your Fedora Core install? I’d be interested to hear if you see the same behavior.

    Erik

  2. Tim
    Feb 11 2009

    I’ll give it a try on the other laptop with FC10 and see what happens.

    -Tim

  3. Feb 12 2009

    So what happened when you tested with FC10?

Leave a comment

required
required

*

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments