I use the Amazon Linux AMI on all my EC2 instances and they come with OpenJDK IcedTea pre installed on them. I have had few issues with OpenJDK when running some applications and I always install the Sun/Oracle JDK 6 on them. Below are the few easy steps / commands to download and install JDK 6 once you log in to the EC2 instance using an SSH client.
Update:
Oracle doesn't provide direct download URLs for JDKs anymore. I have updated the steps with the trick mentioned here to get the installation file with wget
Run java -version to make sure you have the Sun/Oracle JDK as your default jvm now.
9 comments:
thanks for the quick post. worked perfectly.
NB: You now need additional steps to get the file, as Oracle requires you to accept the licence:
a) Go to download page using Firefox, click accept terms
b) Use Export Cookies add-on, to save a cookies.txt file
c) Upload cookies.txt to your instance
d) Then:
wget --load-cookies cookies.txt -O jdk-6u33-linux-i586-rpm.bin http://download.oracle.com/otn-pub/java/jdk/6u33-b03/jdk-6u33-linux-i586-rpm.bin
Thx, works for Java 7 to.
If you download the rpm (no .bin) file call:
rpm -Uvh /path/to/binary/jdk-7u5-linux-i586.rpm
Thanks for the tip !! very useful!!
I use jira and confluence.
It help a lot ,thanks
Wow! I was pulling my hairs out until I saw this post. Thank you thank you thank you!!! More specifically, standard Java library rt.jar will not function out of the box with open JDK. This works well!
great thanks. very usefull
thanks for this post.thanks for the useful tips
Interesting thhoughts
Post a Comment