All you need to do is use the "scp" command (Secure CoPy via SSH) with the "-r" option to recursively copy the folder and all its contents to your N900.
sudo gainroot mkdir /opt/java cd /home/user/MyDocs mv ejre1.6.0_10 /opt/java
sudo gainroot cd /home/opt/java tar -xzvf /home/user/MyDocs/<filename>.tar.gz