Yes, you can. JDK is just a directory somewhere on your drive. Thus, you can easily download and unzip all the versions you need and run java
and javac
from the directory you are interested in.
The IDE will do all the useless things for you: just tell them where the unpacked JDKs are located and select the JDK in the project or module settings.
PS. Java 1.4 is Java 2. Java 2 is actually an umbrella name for 1.2, 1.3, and 1.4.
source share