agraham Expert Licensed User Longtime User Jul 25, 2019 #1 Using OpenJDK 11 and SLC I get this error in some source code I would like to use (steal!). Is there any way to get SLC to permit the use of lambda expressions? Code: Copy error: lambda expressions are not supported in -source 7 post(() -> { ^ (use -source 8 or higher to enable lambda expressions)
Using OpenJDK 11 and SLC I get this error in some source code I would like to use (steal!). Is there any way to get SLC to permit the use of lambda expressions? Code: Copy error: lambda expressions are not supported in -source 7 post(() -> { ^ (use -source 8 or higher to enable lambda expressions)
Erel B4X founder Staff member Licensed User Longtime User Jul 25, 2019 #2 Android doesn't support these features. You can compile it with Eclipse however you will then need to desugar the compiled jar: https://www.b4x.com/android/forum/threads/107278/#content It is currently not possible to change the source setting in SLC. Upvote 0
Android doesn't support these features. You can compile it with Eclipse however you will then need to desugar the compiled jar: https://www.b4x.com/android/forum/threads/107278/#content It is currently not possible to change the source setting in SLC.
agraham Expert Licensed User Longtime User Jul 25, 2019 #3 Thanks Erel - I'll think that I'll give up on this idea. Upvote 0
moster67 Expert Licensed User Longtime User Jul 25, 2019 #4 If you are using Android Studio, as I do, then as I mentioned in this thread, you can simply highlight the "->" sign and then press ALT + ENTER and you get an option to automatically convert Lamda into an Anonymous class. This saves you some time rewriting the code. Don't know if this is available in Eclipse. Upvote 0
If you are using Android Studio, as I do, then as I mentioned in this thread, you can simply highlight the "->" sign and then press ALT + ENTER and you get an option to automatically convert Lamda into an Anonymous class. This saves you some time rewriting the code. Don't know if this is available in Eclipse.
W wes58 Active Member Licensed User Longtime User Jul 25, 2019 #5 Erel said: Android doesn't support these features. You can compile it with Eclipse however you will then need to desugar the compiled jar: https://www.b4x.com/android/forum/threads/107278/#content It is currently not possible to change the source setting in SLC. Click to expand... It is supported by Android Studio because it is using D8 dexer. I have java application with Lambdas and other java 8 codes and it compiles with Android Studio. I thought that there will be support for D8 dexer as in your post #10 in this thread https://www.b4x.com/android/forum/threads/problem-building-library-for-smbj.104232/. Upvote 0
Erel said: Android doesn't support these features. You can compile it with Eclipse however you will then need to desugar the compiled jar: https://www.b4x.com/android/forum/threads/107278/#content It is currently not possible to change the source setting in SLC. Click to expand... It is supported by Android Studio because it is using D8 dexer. I have java application with Lambdas and other java 8 codes and it compiles with Android Studio. I thought that there will be support for D8 dexer as in your post #10 in this thread https://www.b4x.com/android/forum/threads/problem-building-library-for-smbj.104232/.
Erel B4X founder Staff member Licensed User Longtime User Jul 26, 2019 #6 Once you compile the library with Eclipse or Android Studio it is very simple to make it compatible with the current build chain. Just run desugar and it will convert the byte code. Upvote 0
Once you compile the library with Eclipse or Android Studio it is very simple to make it compatible with the current build chain. Just run desugar and it will convert the byte code.