For no good reason MediaTemple does not support Java. By default, the server comes with Ruby, but not a Java compiler. Since this was a huge pain in the rear I thought I would detail the steps to make this happen.

So here goes the directions to install  the latest JDK (1.6) on the VPS server.

Log in to your site through a secure shell, my app of choice is PuTTY. Your going to need to log in as the root user, so make sure to enable root access and set a root password within the account center.

Now check your CentOS installation. You can check that by running the following command on your SSH terminal. Its no doubt your DV has this OS, but check it anyways.

cat /etc/redhat-release

Now the tricky part is to download the Java binaries onto your server. One option is to download the JDK on to your machine and then upload it to server using ftp. Unfortunately, the file size is 70-something MB’s so a better method is to use the wget command.

For this you will need the direct link for the binary download. Using FireFox goto http://developers.sun.com/downloads/ select Java SE, the Java SE (JDK 6), then hit download.

Sun uses a hidden redirect to the actual download. You need to find this URL. The name of your file will be some thing like “jdk-6u4-linux-i586-rpm.bin”

Immediately pause the download and then right click on the “resume” link and copy the large link name to your clipboard.

Now from the SSH terminal, type the following…

wget “PASTE URL HERE” -O java.bin

To paste in PuTTY use Shift-Ins, and make sure to surround the URL with double quotations.

This will download the Java binary as j.bin in the current folder.

Execute it the file by using the following command ./java.bin.

Accept the exceptionally long license terms and continue. You will get the Java installed on the MediaTemple DV server.

Next tell CentOS what you have done by creating a link to your install with the following command

/usr/sbin/alternatives –install /usr/bin/java java /usr/java/jdk1.6.0_04/bin/java 1

If  jdk1.6.0_04 is not the version you downloaded then replace that text with your version

Finally, run java -version on the command prompt to verify the install.

Now the next step is to install Tomcat App server.


COMMENTS / 3 COMMENTS

Great tutorial. How do you not go the extra mile and host the current binary so I don’t have to jump through SUN’s redirect hoop like some kind of monkey? Thanks for the info! It worked great! Now all I have to do is learn Java. Can you post a tutorial on that?

Mr. Wright added these pithy words on Jun 14 09 at 2:04 am

Thanks for this guide, however, a few things were missing in the steps that sort of threw me off.

First, what platform do I choose when downloading the JDK? I think that since we are all reading this from the DV CentOS platform that this choice could be listed. In the end I chose the linux version.

Next, the wget command is: wget -O java.bin

Next, for some reason wget created the file as read only so you will need to chmod 777 java.bin
if you dont, you will get a permissions error.

the alternatives command is with a double dash:
/usr/sbin/alternatives -–install /usr/bin/java java /usr/java/jdk1.6.0_04/bin/java 1
or in my case because i downloaded update 14:
/usr/sbin/alternatives -–install /usr/bin/java java /usr/java/jdk1.6.0_14/bin/java 1

for NEWBS the above command should be used in conjunction with the TAB key to make sure you are getting the correct directories.

John added these pithy words on Jul 24 09 at 10:31 am

it appears that the comments removed all the places where I put greater than and less than symbols…. which sort of ruined my examples…

Next, the wget command is: wget -O java.bin URLHERE

John added these pithy words on Jul 24 09 at 10:32 am

SPEAK / ADD YOUR COMMENT
Comments are moderated.




Return to Top

Installing Java on a Media Temple dedicated virtual server (DV)