Running code dependent on the java version
835647Feb 4 2011 — edited Feb 5 2011I deploy my Java program for Java 1.4
but already use modern features of Java 1.6.
The 1.6 code is run using reflection if and only if the JVM version is 1.6 or higher.
This avoids errors during class loading.
Is this the appropriate way? I do not like reflection that much.
But by searching the forum archive,
I did not find a java feature for including specific code for higher java versions
as means of conditional code blocks for certain Java versions.
Thanks Christoph