openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damjan Jovanovic <dam...@apache.org>
Subject Increase minimum Java version from 5 to 7/8 ?
Date Sun, 09 Jul 2017 12:53:36 GMT
Hi

Currently our Java policy [1] mandates a baseline of Java 5, which was
released in 2004, and was EOL from 2008; even paid Oracle customers stopped
getting updates in 2015 [2].

There are many language and class library improvements in later versions of
Java that we would benefit from in AOO, and if there are no objections, I
would like to increase the minimum version to 7, if not 8.

Java 7 would give us the badly needed try-with-resources feature, better
type inference for generics, and Java 8: lambdas and method references,
better java.util collections and lambda-based APIs for them, unsigned
integer arithmetic, etc.

The only possible downside I see is that the few alternative JVMs that do
exist, tend to only work with older version of Java, for example, the
Apache Harmony class library used in earlier versions of Android only
supported Java 5, GNU Classpath also 5, CacaoVM only supports 6 [3].
Alternative Java implementation aren't relevant to desktop users
(x86/amd64/sparc) any more, since OpenJDK provides free/open-source JVMs
for those, but other platforms and more exotic use cases do need them, eg.
the ARM JVM is only available from Oracle as a commercial product, and the
BugVM project that compiles Java to native code for the iPhone, uses the
Harmony-based Android library.

Having said that, there are ways to compile most Java 7 code into Java 5
classes. For example try-with-resources compiles into a normal
try-catch-finally, with calls to the Exception.addSuppressed() API that
only exists on Java 7, but the class file can be changed to eliminate them;
I already have a tool that does this. So I guess it's only 8 that's
controversial, as it's lambdas compile into "invokevirtual" instructions,
which didn't exist prior to Java 7.

Anyway I am proceeding with (uncommitted) development under the assumption
at least 7 is ok, and will revisit with 8 if possible. Please object soon
if you do :-).

Damjan

References:
[1] https://wiki.openoffice.org/wiki/Policies/Java_Usage
[2] https://en.wikipedia.org/wiki/Java_version_history
[3] https://en.wikipedia.org/wiki/Comparison_of_Java_virtual_machines

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message