Monday, March 15, 2010

Install Maven with a Proxy

First install Maven. For example on Ubuntu 9.10 :

sudo apt-get install maven2

Then we will create the directory $HOME/.m2 :

mvn archetype:create -DartifactId=helloWorld
=> It will create .m2 automaticaly.

Note : Perhaps you can do by hand but I've not tested.You have certainly to check rights.
Note : It could be long and it will make an error but it will create the .m2 directory.

After that you had to create settings.xml in the .m2 directory like that :

vi settings.xml


To resume, you have a .m2 directory similar to that :

Then go on your workspace directory (ex :$HOME/workspace) and launch the following command : mvn archetype:create -DartifactId=helloWorld

Monday, March 8, 2010


I just come back from my holiday and I saw nice comment on my blog.
So thanks for these comments ! If you wan to see some article or you prefer other subject, tell me !
I will be happy to publish them.

Android books

To learn android, I've bought a books.This book is "L art du developpment Android".
This book was write by Mark Murphy.So fo the US, search Marc Murphy and you should see an equivalent.I put some links on my android blog MyAndroidBlog
So I will just summary advantages and drawbacks of this books :

Advantages :
- A lot of small chapter with exercises.
- Good explanation.
- Not too much eclipse 's configurations.Be careful, a lot of android's books speak a lot of about eclipse but not about developing with android.

- Some class are not write with best practices.
- Eclipse configuration.

So if you love developing java and you want to learn something different (Android) with me, you can see my blog : MyAndroidBlog

Wednesday, March 3, 2010

SCJP exercise : initialisation

Exercice :


Given the following :

public class Test {

    private int myvar=3;
    public Test(int myvar) {

        if (myvar == 5) {
            myvar = 2;
        } else {
            myvar =3;

    public void show() {
        System.out.println("myvar:" + myvar);

    public static void main(String[] args) {
        Test test = new Test(4);;

What is the result (choose one) :
A: myvar:2
B: myvar:3
C: myvar:4
D: myvar:5
E: Compilation fails
F: An exception is thrown at runtime

Solution :