Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

They forked Java by cherry picking features and APIs, and are making it increasingly difficult to write portable code across standard Java and Android Java.

Any Java library that depends on Java 7 or 8 standard libraries not available on Android, newly introduced JVM bytecodes, some of the Java 8 language features, annotation processors, ... isn't usable on Android.

Good luck getting Java 9 modules, or eventually Java 10 value types and updated generics when they become available.



sort by: page size:

And since they doubled down on their Android Java flavour, it is now a major headache to produce modern Java libraries that work on Android.

Even if you castrate yourself to Java 7, whatever works depends pretty much on the Android version.


Google has no interest in providing the right support for Java developers it seems.

Lack of Java 8 bytecode now, then lack of Java 9 modules tomorrow, and eventually lack of Java 10 value types and improved generics, arrays and JNI replacement.

And of course, lack of many of the SE APIs in any case.

The fun of writing portable libraries between Java and Android Java is only getting better.


Rightly so, after they pulled a Microsoft into Java.

Now any Java developer writing libraries is forced to write Android specific versions thanks to how Google forked Java.

No 100% support for all JVM bytecodes, so no invokedynamic support. Cherry picked packages and classes from Java 6, 7 and 8.

It will only get worse with the current Java roadmap.


Not really.

A subset of Java with partial support for the standard library is the the lingua franca of Android, forcing a fork on the Java community for any library author that wants to target standard Java and Android Java.


On Android is the only sane path out of the Android Java fork, stale in Java 6, with cherry picked features from Java 7 and 8.

Yet another feature that Android devs won't get.

By the time Java 10 gets out, they can see how libraries that make use of modules, reified generics, value types, GPGPU integration, JIT plugins are out of reach.

Worse even, having library devs writing two versions of their libraries.

Google's fork of Java is leading to a Python 2 - 3 scenario.


Kind of.

They are supporting Java 8 language features depending on the Android platform version.

Some Java 8 library APIs have been adopted, but require the latest Android versions.

Finally, the JVM bytecodes like invoke dynamic and method handles aren't supported thus making libraries that use them, unusable on Android devices.


Though I understand their reasoning to a degree, it does seem perverse that they adopted the most pedestrian bit of java -- the language -- while jettisoning the crown jewel -- the JVM.

It hasn't been trivial to get other JVM languages working on Android, and ironically that list now includes Java 8.

Oracle are largely to blame, I suppose.


At least for Android development it will be quite an improvement.

Google made their Java fork, for Java 7 and 8 they only cherry picked features, even after migrating to OpenJDK.

The newly introduced bytecodes are not supported and the situation will only get worse with Java 9 and the new OpenJDK release schedule.

Specially given the lack of updates across the Android eco-system.

So only something like Kotlin allows to enjoy modern JVM languages while targeting Android.


The only Java I have issues with is a fork called Android Java.

Android is a better example of forking Java, to be honest.

Part of the issue is that a lot of libraries target jdk 8 since that's what Android supports.

Sorry, Android doesn't have all of Java 8 and it's mostly Kotlin now.

Forked != out of date. Android code is still Java code. you just compile to Dalvik bytecode instead of jvm bytecode.

If you think that's wrong, fine but that lawsuit had nothing to do with bytecode.


Java portability was a main feature of Java. Kill that and you kill Java. Java Android is not really Java.

Yeah, Android Java has turned into Google's own version of J++.

Worse is that Kotlin fanboys don't get it, that without access to modern Java their Java FFI is worthless, as all Java 8+ libraries on Maven Central will slowly become useless on Android no matter what.

Additionally the language cannot expose JVM capabilities, unless they had even another backend.

So it will be stuff like value types, JNI replacement, proper generics, customized JIT and SIMD on the JVM, and plain old Java 8 on ART.


Java might be source compatible, but sometimes it is quite fun to make libraries work across versions.

Specially if they rely on APIs that did break, like JDBC interfaces.

Also Android Java isn't 100% Java as Google cherry picks APIs, which with the increase of Java 8's adoption is increasing the effort to write portable libraries that compile against Java and Android Java.

Also Android Java runtimes don't understand the bytecodes introduced in Java 7 and 8. So you cannot use libraries that make use of them.

This will only get worse with Java 9 modularity and with the value types, reiffed generics and new FFI planned for Java 10.


The Android tools now have essentially-fake support for Java 7. Basically, they updated dx (the classfile-to-dex converter) to not throw exceptions immediately upon encountering a v51-format (Java 7) classfile, but, rather, to throw exceptions whenever such a file actually contains Java 7-specific bytecode features (MethodHandles, InvokeDynamic, and related features). This means that Android has support for the syntax-only features of Java 7 (the ones implemented entirely upstream in javac), but falls short of implementing any of the actually-interesting platform features that would have required changes to the phone-side VM.

Edit: The reason I bring this up (apart from being a little bit sore about it, personally), is that this means that Android is actually really far from Java 8 support, as these features were added in Java 7 at least partially to facilitate lambda support in Java 8 (see http://cr.openjdk.java.net/~briangoetz/lambda/lambda-transla...).


I don't believe, given what they repeat at every Google IO when people ask about it.

Also I don't have any issue with Java as I do like the language and use it since JDK 1.0.1.

My issue is with Android Java, a forked version of Java with cherry picked features of Java 6, 7 and now 8, just because Google didn't want to pay Sun.

A version that will be even harder to write portable code when Java 9 and 10 come out.

next

Legal | privacy