I cannot comment on the Ubuntu question. However I would go with the newer Postgres versions. Especially 8.3 I wouldn't use anymore, it's very old by now and went EOL last February.
As for the answer to your Java version question, it can be found in our documentation, quoting: "Starting from Mendix 4.1, we do support JRE 1.7 update 5 or higher." For on-site deployments you could look at OpenJDK 1.7 but note we haven't done extensive testing for this.