How to install, specific version of Java by command line on Mac? It's Possible?
It's possible it install various versions of java. 

It's not possible to be of more assistance without details on what versions you have and some explanation of what your sticking point is.

Oracle does not distribute 1.6 for OS X so you'll need to get an update from Apple to get that version.

The simplest way would be to install older OS on to virtual machines if you don't run the specific OS X version that was current when Java 1.6 was current.