Can java8 lambda be used in java snippet?

Hi,dear Knimer.

i wrote few java codes in java snippet,but kinme showed some errors like below:


WARN  Spark Java Snippet (Source) 0:140      Compilation error(s): Unable to compile expression
ERROR at line 28
Lambda expressions are allowed only at source level 1.8 or above


i checked my jre-env (1.8) and knime->preference->java->compiler (1.8) /installed JREs (1.8) .everythings seems fine.i've no idea :(

if java snippet in kinme 3.2 can use lambada? How can i fix this?


I don't know how you can fix it, but they appear to work for me.

I too have the same problem. I use the KNIME 3.5.2. My code is trivial:

import org.apache.spark.SparkContext;
import org.apache.spark.sql.types.*;
import org.apache.spark.sql.*;
import static org.apache.spark.sql.functions.*;
import org.knime.bigdata.spark.core.exception.*;
import org.knime.bigdata.spark2_2.api.RowBuilder;

public class SparkDataFrameJavaSnippet extends AbstractSparkDataFrameJavaSnippet {

	private static final long serialVersionUID = 1L;

    public Dataset<Row> apply(final SparkSession spark, final Dataset<Row> dataFrame1, final Dataset<Row> dataFrame2) throws Exception {

	    class Record {
		    int label;
		    int[] features;
	    JavaRDD<Record> rdd1 = dataFrame1
		    .map(row -> {
			    Record record = new Record();
			    return record;

	    return spark.createDataFrame(rdd1, Record.class);