I don't think there is anything wrong in your code. The problem here is (even I don't know the reason) - java -version is not returning anything to stream.
e.g. if you simply run java instead of java -version from your code, it'll give you expected output. But I'm not aware about reason behind this behavior of java -version.
Apart from that, if you want to check java version pro grammatically, this thread might be helpful.
Thanks to all for your responses¡
I tried using the errorStream instead of the inputStream, but it didnt make any difference.
My main goal is to know if the application is running with java 32 or 6bits, so I believe i will end solving it by using System.Property(java.home). It returns the path were java is installed, but it believe
that i can play with that path, like checking if it contains "(x86)" then the JVM being used should be 32bits, otherwise it is 64bits.