Compiling GWT with Java 8 compiler, but keeping GWT code to only use Java 6 constructs - possible?

121 views
Skip to first unread message

Jean Barmash

unread,
Jul 31, 2014, 2:43:04 PM7/31/14
to google-we...@googlegroups.com
I'd like to upgrade my project to Java 8.  We use GWT 2.0.3.

I have read the updates about full support of Java 8, and understand that to fully support it, the GWT code generator needs to support all Java8 features. 

However, what I need is a bit different I am happy to freeze the code UI code that interacts with GWT to only use Java6 constructs, so I don't need the code generator to support Java8 features.  

Is this possible?   I.e. to get my project compiled with Java 8, if the GWT code is only using Java 6 features.  

Would love to hear some opinions, as well possibly an update on the full Java 8 support timelines.   I saw that there is a fork that tried to move along this path.  

Thanks,

Jean


Thomas Broyer

unread,
Jul 31, 2014, 3:01:57 PM7/31/14
to google-we...@googlegroups.com


On Thursday, July 31, 2014 8:43:04 PM UTC+2, Jean Barmash wrote:
I'd like to upgrade my project to Java 8.  We use GWT 2.0.3.

I have read the updates about full support of Java 8, and understand that to fully support it, the GWT code generator needs to support all Java8 features. 

However, what I need is a bit different I am happy to freeze the code UI code that interacts with GWT to only use Java6 constructs, so I don't need the code generator to support Java8 features.  

Is this possible?   I.e. to get my project compiled with Java 8, if the GWT code is only using Java 6 features.

Absolutely.
AFAICT, you'd have to compile (javac) the classes with "-source 1.6 -target 1.6" too, so you'll have to have your client-side (GWT-compatible) and server-side code clearly separated.
 
Would love to hear some opinions, as well possibly an update on the full Java 8 support timelines.   I saw that there is a fork that tried to move along this path.

Java 8 support will unforteunately won't make it to GWT 2.7 to be released this summer. You'll have to wait for 3.0 (to be released this winter) 

Jean Barmash

unread,
Jul 31, 2014, 5:21:18 PM7/31/14
to google-we...@googlegroups.com
Great, thanks!   I do have the UI code separate into separate maven build, so I should be able to use this approach.  

Jean
Reply all
Reply to author
Forward
0 new messages