Monday, April 23, 2012

How to apply Checkstyle format automaticaly ?

Problem :

You want to format your code with checkstyle rule with CTRL-ALT-F.

Solution :

Right clic on the project -> Checkstyle -> Create a Formatter

Then go Windows -> Preferences -> Code Style -> Formatter 

Next, you just have to select the formatter you have created.
After that, you can make CTRL - ALT - F to format you code

Saturday, April 21, 2012

java 1.8 lambda example

I saw at Devoxx France, a conference about java 1.8 and the use of lambdas by Guillaume Tardif. (

In this article, I will show you an example.You can dowload the jdk here :

To install jdk1.8 on Ubunutu, you can do :

sudo mv ./jdk1.8.0 /usr/lib/jvm/
sudo update-alternatives --install “/usr/bin/java” “java” “/usr/lib/jvm/jdk1.8/bin/java” 1
sudo update-alternatives --install “/usr/bin/javac” “javac” “/usr/lib/jvm/jdk1.8/bin/javac” 1

sudo update-alternatives --config java

Then, you just have to choose the jdk.

Note : I have a bug when I use javac because javac -version show me always 1.6 and not 1.8
So to compile, I've done the following :

java Main

Here is my file

import java.util.ArrayList;
import java.util.List;

public class Main {

public static void main(String[] args) {
List names = new ArrayList();
names.forEach( (String s) -> { System.out.println(s);} );


Then we show on the screen :


An other important point, Java 1.8 should support multiple inheritance !
If you have comment, post it !

Tuesday, April 17, 2012


Tomorrow it's the beginning of a great conference.

During 3 days, there will be technical session on JAVA, HTML5, NOSQL, CASSANDRA ... et all new technologies !
Go to the web site to see trend of the moment devoxx