How do I know what version of Java is being run in Eclipse?
Is there a way to write code to find out?
Is \"JRE System Library [JavaSE-1.6]\" in \"Package Exp
Don't about the code but you can figure it out like this way :
Go into the 'window' tab then preferences->java->Installed JREs. You can add your own JRE(1.7 or 1.5 etc) also.
For changing the compliance level window->preferences->java->compiler. C Change the compliance level.
String runtimeVersion = System.getProperty("java.runtime.version");
should return you a string along the lines of:
1.5.0_01-b08
That's the version of Java that Eclipse is using to run your code which is not necessarily the same version that's being used to run Eclipse itself.