Re:Kotlin: A New Hope in a Java 6 Wasteland
by cdbattags on Monday September 28, 2015 @12:32PM
(#10291300)
It might be a stupid ask, but: What would it take for Android to start support for a different dev language (being able to write an app in js or Swift for example)? Also, is it never the case that when a new language is released (Java 8 for example) there is usually a strong emphasis on backwards compatibility (compiling into all or a few previous versions' bytecodes)?
[ Parent
| on HN ]
Re:Kotlin: A New Hope in a Java 6 Wasteland
by acveilleux on Monday September 28, 2015 @04:53PM
(#10293126)
You can get Java 6 bytecode from a Java 8 compiler but it will fail to compile if you used Java 8 features:
$ jdk-1.8-64/bin/javac -target 1.6 -source 1.6 LambdaTest.java
warning: [options] bootstrap class path not set in conjunction with -source 1.6
LambdaTest.java:16: error: lambda expressions are not supported in -source 1.6
Runnable r2 = () -> System.out.println("Hello world two!");
^
(use -source 8 or higher to enable lambda expressions)
1 error
1 warning
Trying to heed the error: $ jdk-1.8-64/bin/javac -target 1.6 -source 8 LambdaTest.java
javac: source release 8 requires target release 1.8