I have a situation where the deployment platform is Java 5 and the development happens with Eclipse under Java 6 where we have established a procedure of having a new workspace created when beginning work on a given project. One of the required steps is therefore setting the compiler level to Java 5, which is frequently forgotten.
We have a test machine running the deployment platform where we can run the code we build and do initial testing on our PC's, but if we forget to switch the compiler level the program cannot run. We have a build server for creating what goes to the customer, which works well, but this is for development where the build server is not needed and would add unnecessary waits.
The question is: CAN I programmatically determine the byte code version of the current class, so my code can print out a warning already while testing on my local PC?
EDIT: Please note the requirement was for the current class. Is this available through the classloadeer? Or must I locate the class file for the current class, and then investigate that?