How to auto generate Java 8 code in eclipse -


how can generate java 8 specific code in eclipse ide. example using collections, on pressing cntl + enter; instead of generating following

 collection<string> list = new arraylist<string>(); 

it should generate

 collection<string> list = new arraylist<>(); 

note: cntl + 1 convert anonymous interface lambda expression.

you should choose correct jre system library project , autocompletion change accordingly java version used.

i have created project named test-java-1.6 , have verified java autocomplete not support diamond operator because of old java version.

the autocomplete behaviour changed after java version update.

here how specify java execution environment:

properties java project

and how change newer version, here should choose javase-1.8

edit library


Comments