How do I install Java JDK 7 on a TKL machine? It does not matter if it is Oracle or OpenJDK
Then should find plenty of info by googling something like 'install java7 ubuntu 10.04 server' 'headless' might also be a useful search term. If you are using the v12rc then substitute 'debian squeeze' for 'ubuntu 10.04' (although I would expect the instructions would be pretty much the same).
More information about formatting options