Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

Testing banner

How to use Java 8 Lambda Expression in Java 7

3211294May 11 2016 — edited May 11 2016

Hi everybody,

I have a question. I try to client to soap web service. in sample using java 8 but my project provide java 7.

https://spring.io/guides/gs/consuming-web-service/  I am working on example in this link.

-----------------------------------------

CommandLineRunner lookup(WeatherClient weatherClient) {
return args -> {
String zipCode = "94304";

if (args.length > 0) {
zipCode
= args[0];
}
GetCityForecastByZIPResponse response = weatherClient.getCityForecastByZip(zipCode);
};
}

-----------------------------------------

This example writen in java 8, it used lambda expression but I couldn't find how to write correctly with java 7.

So, can you help me about how to write correctly?

Thanks for all

Comments
Post Details
Added on May 11 2016
1 comment
754 views