Hacker News new | ask | show | jobs
by devdoomari 3325 days ago
thought recent android's tools update meant I can use java8 on android devices...

guess that requires a recent android device :(

2 comments

The devices themselves still run a JVM (Dalvik and ART) that's basically compatible only with ~JRE7 bytecode. There are some new features in ART since N, but still the JVM isn't fully Java 8 compatible (afaik invoke-dynamic for lambdas is still not supported).

So the Java 8 tools you're talking about essentially take Java 8 compiled bytecode and patch out the parts that aren't compatible with device JVM (e.g. they replace lambda invocations with anonymous classes like you'd use on Java 6 etc.).

This doesn't work for things like Scala which use these new features in patterns those tools can't patch/recognise.

The amount of supported features depends on the target API of the application.