Bug 461334 - Support Java 1.8 as an execution environment
Summary: Support Java 1.8 as an execution environment
Status: RESOLVED FIXED
Alias: None
Product: andmore
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: 0.5-M1   Edit
Assignee: David Carver CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2015-03-03 15:14 EST by Tom Golden CLA
Modified: 2015-03-15 20:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Golden CLA 2015-03-03 15:14:00 EST
Although only limited Java 7 features are available on the Android platform, projects like retrolambda allow limited Java 8 features to be backported by means of transforming the compiled class files to an acceptable format for the dex builder.

However, Eclipse ADT prevents the use of Java 8 as a runtime, meaning that one cannot edit sources for Android which use these lambda expressions, even though they will be converted to anonymous inner classes or equivalent expressions before being dexed.

It would be nice if Andmore would allow me to use the Java 8 execution environment for an Android project (whether configured manually or picked up from my POM by m2e-android) and trust me not to shoot myself in the foot. :)
Comment 1 David Carver CLA 2015-03-04 09:22:42 EST
Tom this I believe is controlled at the following location.

https://github.com/eclipse/andmore/blob/develop/android-core/plugins/org.eclipse.andmore/src/org/eclipse/andmore/AndmoreAndroidConstants.java#L223

It should be fairly easy to add Java 1.8 as a supported target platform.  I recently changed the default compiler level for new projects to be 1.7.

Around line 226 you can add the necessary code for Java 1.8.   There may be a few more places that need to be changed as well, but this should give you a starting point.

It would be great if you could submit a pull request on GitHub so we can get this in as quick as possible to meet your needs.
Comment 2 Tom Golden CLA 2015-03-04 09:26:29 EST
Thanks for the tip, David. I'll try to check it out over this weekend.
Comment 3 David Carver CLA 2015-03-10 21:56:26 EDT
(In reply to Tom Golden from comment #2)
> Thanks for the tip, David. I'll try to check it out over this weekend.

Will see if we can get this implemented during the Eclipse Hackathon at eclipsecon.
Comment 4 David Carver CLA 2015-03-11 11:48:02 EDT
https://github.com/eclipse/andmore/pull/72

Fixed.  Java 1.8 is now available. Users should be careful and know why.  We still default to Java 1.7 compliance level when creating a new project.
Comment 5 David Carver CLA 2015-03-15 20:51:55 EDT
Fixed.