B4J Question error: lambda expressions are not supported in -source 1.7

fhersof

Member
Java:

Hello please help,
In B4J when compiling I get the error shown in the photo, I'm using jdk 1.80_45, thank you very much.
 

fhersof

Member
I have tried with jdk 11 and the lambda problem disappears but some important libraries are affected for me, is it possible to revert this lambda to traditional code?
B4X:
    public static void main(int intport) 
    {
        VpnServer myVPN = new VpnServer(intport);
        myVPN.listen();
    }
    ------
    ------
        public void listen()
    {
        new Thread(() -> {
            while(running.get() && (serverSocket != null) && serverSocket.isBound())
            {
                try { serviceThreads.add(new RequestHandler(serverSocket.accept())); }
                catch(SocketTimeoutException e1) { /* Nothing to do here */ }
                catch (IOException e2) { e2.printStackTrace(); }
            }
        }).start();
    }
 
Upvote 0
Top