I have this code inside a B4J library of mine placed inline with java.
It works correctly if I compile with Java 11 but if I compile with Java 8.202 it tells me that it can't compile in java 7 (strange since I compile with 8 and that if compiled outside b4j it doesn't throw an error).
My question since I know very little about java, how could I change this Lambda into a normal function.
It works correctly if I compile with Java 11 but if I compile with Java 8.202 it tells me that it can't compile in java 7 (strange since I compile with 8 and that if compiled outside b4j it doesn't throw an error).
My question since I know very little about java, how could I change this Lambda into a normal function.
Java:
Future<KeyPair> keyPairmain = Executors.newSingleThreadExecutor().submit(()->
{
KeyPair keyPair = null;
try
{
System.out.println("creating RSA keypair...");
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(2048);
keyPair = keyGen.genKeyPair();
System.out.println("creating RSA keypair...done");
}
catch (Exception e)
{
System.out.println("creating RSA keypair exception");
}
return keyPair;
});