I have a situation where the deployment platform is Java 5, and development takes place with Eclipse for Java 6, where we set up the procedure for creating a new workspace when starting work on this project. Therefore, one of the necessary steps sets the compiler level in Java 5, which is often forgotten.
We have a test machine with a deployment platform where we can run the code that we create and perform initial testing on our computers, but if we forget to switch the compiler level, the program will not work. We have a build server to create what goes to the client, which works well, but this is for development, where the build server is not needed and will add unnecessary expectations.
Question: CAN programmatically determine the version of the byte code of the current class, so my code can print a warning already during testing on my local PC?
EDIT: Note that this requirement is for the current class. Is this accessible through class class? Or should I find the class file for the current class, and then examine this?
source
share