Why is it not possible to compile with JDK 8

176 views
Skip to first unread message

Jacques

unread,
Feb 20, 2016, 7:16:09 PM2/20/16
to mapsforge-dev
Hello,
I tried to run the mapsforge-master project from android studio to a virtual android emulator but it gives an error and couldn't be compiled with JDK 8. Why is that?
I tried to point to openJDK 7 on android studio project structure window, but seems android studio doesn't recognize openJDK.

Here are the errors:

Error:com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
 
Error:Execution failed for task ':Applications:Android:Samples:transformClassesWithDexForOldpermissionsDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1


Thanks

Emux

unread,
Feb 21, 2016, 3:01:09 AM2/21/16
to mapsfo...@googlegroups.com
Android had mostly Java 6 compliance and Java 7 support was added from Android KitKat SDK era.

"Added support for Java 7 language features like multi-catch, try-with-resources, and the diamond operator. These features require version 19 or higher of the Build Tools. Try-with-resources requires minSdkVersion 19; the rest of the new language features require minSdkVersion 8 or higher."

There is not any official recommendation for Java 8 yet.

About AS look here:
http://developer.android.com/sdk/index.html#Requirements

--
Emux

Ali

unread,
Feb 21, 2016, 6:02:31 AM2/21/16
to mapsfo...@googlegroups.com
Thanks.

The issue has been resolved by installing oracle JDK 7 and pointing out it on AS. 
Anyway my new android projects in AS have had no problem with JDK 8 and are compiled via that.

Regards

--
You received this message because you are subscribed to a topic in the Google Groups "mapsforge-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mapsforge-dev/_IsCJXXnTBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mapsforge-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapsforge-dev/56C96EC1.1080503%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages