NBANDROIDTEAM / NBANDROID-V2

Netbeans Android support plugin
Apache License 2.0
94 stars 25 forks source link

NBAndroid does not seem to support Java 8 #212

Closed mweisshaupt1988 closed 5 years ago

mweisshaupt1988 commented 5 years ago

I have used a lot of Java 8 Lamdas in my code and it does not seem to work in the newest version of the plugin. I have created a simple Testapplication to showcase the issue.

Runtime information: OS: Ubuntu 19.04 Java: OpenJDK-11.0.3 NetBeans 11

Java-8-Issue

TestApp.zip

arsi-apli commented 5 years ago

I have no idea what is the problem. Throug SourceLevelQueryImpl I return 1.8, but it still displays that -source 7

https://github.com/NBANDROIDTEAM/NBANDROID-V2/blob/e9672754c680b53b782dfcf870910708866784cd/nbandroid.core/src/main/java/org/netbeans/modules/android/project/sources/SourceLevelQueryImpl.java

arsi-apli commented 5 years ago

Even though the source level of /hdd/A/TestApp/TestApp_mobile/src/main/java:/hdd/A/TestApp/TestApp_mobile/build/generated/source/apt/debug:/hdd/A/TestApp/TestApp_mobile/build/generated/source/buildConfig/debug:/hdd/A/TestApp/TestApp_mobile/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r:/hdd/A/TestApp/TestApp_mobile/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r is set to: 1.8, java.lang.invoke.LambdaMetafactory cannot be found on the bootclasspath: /home/arsi/.cache/netbeans/11.0.android.1/android_virtual_java8:/hdd/A/sdk3/platforms/android-28/android.jar:/hdd/A/sdk3/platforms/android-28/optional/org.apache.http.legacy.jar:/hdd/A/sdk3/platforms/android-28/optional/android.test.mock.jar:/hdd/A/sdk3/platforms/android-28/optional/android.test.base.jar:/hdd/A/sdk3/platforms/android-28/optional/android.test.runner.jar Changing source level to 1.7

An additional test has been added to ANB JavacParser:

java.lang.invoke.LambdaMetafactory I'll try to make a dummy class file in AndroidClassPathProvider

arsi-apli commented 5 years ago

;) image

arsi-apli commented 5 years ago

Wait for approx. 10 minutes and update your plugin...