If you download the linux binary from Sun you can install it in whatever directory you like. Then just reference those libs in your code, and you're good to go.
With the binary installer, it'll create its own named subdirectory (e.g. in your example, /usr/java/jdk1.5.0_), so you can download as many as you want, and they'll line themselves up in appropriately named sub-drectories.
The main java binary lives in /usr/bin, so if you want to replace that to the point where when you type "java" it accesses your java, and not that one, you just move the old one out of /usr/bin, and link your new one in there. Typing which java
will tell you what the default java on your system is.
@jldupont: When I think of concurrent installs, I think of multiple versions installed on the same machine, which my method will absolutely give you. I have about 12 versions of java installed on my production box to handle hand-me-downs from corporate that haven't yet been updated.
However when you type "java" you're only going to get one version of java, since that's what's in '/usr/bin'...You'd have to type something like '/usr/java/jdk1.5.1/bin/java' to get a specific java binary that's not the system default.