That sounds rather complicated. What OS do you have? Why tar.gz? Why do not install Java simply from this link Java 8 ?