Hi Emmanuel, > Out of curiosity, why is such a sophisticated Java version detection > logic necessary? As far as I know it's rather unique. If gettext only > needs a Java 1.4 compiler any version of Java released in the past 15 > years is suitable anyway.
The 'javacomp' macro and module are made for packages that install compiled Java code (.jar files), which may be run by a different Java version than the one that compiled it. 1) Due to the bytecode format, code compiled by java version X (without particular options) cannot be run by java version Y, where Y < X. This is not a problem for distros, because distros know which is their minimum supported Java version, but is a problem when users compile a package on their own. So, the need arises to use the '-target' option. But not all javac versions support the '-target' option; GCJ had a different but similar option. So one needs to look carefully at the javac compiler version... 2) The Java language evolves. Code that was correct in the past may not compile with newer Java versions, without particular options. For example, code that defines a method named 'assert' or 'var'. So, one needs to use the '-source' option. Again, this option depends on the compiler brand and version. Additionally, the two are intertwined, because you cannot use the '-target' option without the '-source' option... Bruno