Does jGRASP support Java lambda expressions? -
i've worked in jgrasp time, , started working lambda expressions in java. can compile programs lambda expressions, when try run them error:
no main methods, applets, or midlets found in file
example program:
public class squarecomputer { interface integermath { int operation(int a); } public int operateunary(int a, integermath op) { return op.operation(a); } public static void main(string... args) { squarecomputer myapp = new squarecomputer(); system.out.println(myapp.operateunary(3, -> a*a)); } }
if comment out last line, program compiles , runs expected (doing nothing, of course).
note program cut-down version of calculator example in oracle tutorial here. if use whole calculator program, same thing happens: compiles fails find main method run; comment out lines using lambda expressions, , runs fine. likewise other program i'm working on; single line compiled lambda expression causes program fail find main method.
is problem jgrasp, or java installation, or understanding, or else? , how can resolve this?
edit: few more data points: if have jgrasp display uml diagram, class lambda expression uniquely marked "external class or interface" (without lambda expression, marked "project class").
if try make jar file via jgrasp, regular expression, jgrasp cannot find main-class; once specify it, jar class made, , can run successfully, behavior wanted, outside jgrasp.
i using out-of-date version of jgrasp (from 2013, before introduction of lambda expressions java in 2014, believe). updating installation of jgrasp current version cleared problems finding main-class when lambda expression compiled.
so: yes, jgrasp support lambda expressions (at least version 2.0.1_09). no, did not prior appearance of lambda expressions in java (sometime after version 2.0.0_03).
Comments
Post a Comment