I need to compile my source code to be compatible with jre 1.6. However, when I attempt to set the compiler attribute of the javac task to be javac1.6, ant will still compil
I thought it would be nice to add an updated answer to this question, since I recently dealt with a lot of headaches surrounding this same issue. My specific use case: My computer uses JRE1.8, but I needed ant to target JRE1.7 running on the server. The trick for me was to use the following attributes in combination (referencing the documentation):
You don't have to specify the executable file unless you have really specific dependencies (e.g. more recent enterprise version as opposed to latest free version).
Example: