I compiled the code using the maven script provided by apache but I'm not sure it will run in Java6. Can anyone confirm whether or not this library will work with Java6?
If not naturally, then is there a way to do this somehow?
No, WSS4J 2.1.x requires JDK 7. WSS4J 2.0.x works with JDK 6.