Install Java 8 on Amazon Linux 2018.03 version without upgrading the Java 7 on the server

-1

I would like to install latest stable version of Java 8 available through the normal package installation mechanism on Amazon Linux 2018.03 machine. Java 8 should not become the default Java. The default version should stay as-is. Java 8 will be used by setting the appropriate configuration to reference it.

Please let me know how I can configure. Thanks in advance.

nag

Posted 2019-06-16T23:22:10.463

Reputation: 1

Answers

0

What you want to do is to install Java 8 in $HOME rather than in /usr. This is always a good practice because, if you mess up, you can just rm -rf ~/.local, and it's no-harm/no-foul on the box. On the other hand, if you mess up inside /usr or equivalent, then you have a whole different set of issues.

Please specify which OS you're on (I guess it's either Ubuntu or CentOS.) In the former case, download the .deb package for Java 8 and follow this guide to installing it in $HOME. After that, you can set an environment variable to set your default Java to that one locally within that environment, but not globally.

https://askubuntu.com/questions/339/how-can-i-install-a-package-without-root-access

If you're on CentOS, the best move would be to download the source and build it with autotools (same procedure - just don't use yum.)

Hari Amoor

Posted 2019-06-16T23:22:10.463

Reputation: 101

I am using rhel fedora – nag – 2019-06-17T12:03:58.163

Then just download from source; that should be fine. – Hari Amoor – 2019-06-24T09:25:48.317