I only know the manuel solution: try it. However, there are two things to consider.
- For which version is the code language compatible?
- Why will the JRE be run?
The first thing you can do with your current JDK is to simply -source over the -source and -source arguments that you pass to your javac compiler. This, however, will not stop you from using the classes and methods from the JDK that you are using. If you do this, the code will not execute for a lower JRE if you use classes or methods that are not present there.
The easiest way would be to install all the different JDKs and try to compile the code with each of your compilers.
source share