Android Question error in Simple Library Compiler

sadegh.nordeh

New Member
Hello
When I use Simple Library Compiler to build a library, unfortunately I get this error


error: cannot find symbol
new Thread(() -> {
^
symbol: method metafactory(Lookup,String,MethodType,MethodType,MethodHandle,MethodType)
location: interface LambdaMetafactory
Fatal Error: Unable to find method metafactory
Error.

And my Java version is 1.8 and I did everything but I couldn't compile it.
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hello
When I use Simple Library Compiler to build a library, unfortunately I get this error




And my Java version is 1.8 and I did everything but I couldn't compile it.
I dont think SLC likes Lamda expressions such as the "->" expression in the code. I might be wrong but have had similar issues before with Lamda expressions and had to modify the Java code to do away with Lamda expressions.
 
Upvote 0

Johan Schoeman

Expert
Licensed User
Longtime User
@Johan Schoeman is correct. SLC, or rather BADoclet, requires Java 8 but Java 8 does not support lambda expressions so you need to recode them.
It takes a bit of browsing the web to convert it but it can be done.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…