Ant compiling some classes to 1.7 despite -target 1.5?

Catch-22

Active member
Has anyone who builds KoLmafia ever ran into the issue where ant decides to compile 1 or 2 classes as JDK7 classes despite being given the 1.5 target directive?

I have had it happen before and the quick fix is simply to delete the "build" directory and try again, but I'd like to get to the bottom of it as it seems to be what has been causing my native Windows build scripts to error out every once in a while (and consequently stay broken until either I notice it myself, or somebody nudges me on the forums).

The frustrating thing is that the resulting JAR file will run fine (because I'm using an up to date JRE) but Excelsior JET doesn't support 1.7 classes, so it won't go through with the build process.

The most recent culprits were:

net/sourceforge/kolmafia/persistence/CustomItemDatabase.class
net/sourceforge/kolmafia/KoLConstants.class


being the only class files to come out as 1.7, I think I've had problems with KoLConstants before. It's a head scratcher though, because as I said the "quick fix" is simply to delete the compiled class and try again and hope ant does what you've asked it to do.

Anyone else ran into this quirk? Know how to fix it properly?

Edit: I should let you know that the build environment is Windows 8 64-bit, but I've ran into the issue on Windows 7 and Windows Vista, too. I'm using Ant 1.9.0 and I'm about to check if there's a newer version.
 
Last edited:
Top