You will need the rt.jar
from a 1.4 JRE (for instance by having the 1.4 JRE installed). If using javac
use the following options:
javac -source 1.4 -target 1.4 -bootclasspath /path/to/j2se1.4/lib/rt.jar [...]
Using javac
from a later JRE means that it should have fewer bugs for old source, although it may not necessarily be entirely "bug compatible".
You might also want to use -Djava.ext.dirs=directories
and -Djava.endorsed.dirs
, but putting things in those directories is generally a bad idea.
Note: Even 1.5 has finished its End Of Service Life period. Get with 1.6! (Or buy one of our excellent Java for Business contracts...)