You need to tell the VertexArray what primitive type you want to use and add the correct constant for lines and its size (0 at first) to the constructor call.
That you cant change the color is probably a limitation of the Java-binding (I didn't use SFML with Java, but it was similar in Ruby).
I think you should be able to create the Vertex with the color directly.
Vertex v2 = new Vertex(pos,color);
Btw., it is bad to recreate the VertexArray anew every frame if you only use the same data (even if in such a tiny example program you wont notice a difference). You better move that code above of the gameloop. If later your game logic says it changed the data its based on, you can recreate it at a frame if it happens.