There doesn't seem to be any apparent reason why it should not work with classes12.jar.
One of the things you could verify is that your classes12.jar is not corrupted.
If you want to debug this further, copy and paste the entire exception stack trace. Also paste your code again with the line numbers, so that the lines in the exception stack trace can be related to code.