What are the maximum number of threads which can be maintained by the Java virtual machine?

I did not explain this in my original question, but I am trying to benchmark the JVM and would like to try and see how many threads it can concurrently maintain. 

Creating threads in a loop until an exception is thrown is an option, however, I would like to know if there is a better way to do this.