Installing 64-bit Java on Ubuntu Server

0

I am trying to install 64-bit java on my Ubuntu server so I can host a Minecraft server. I have downloaded the package from java.com, extracted the file (it has no extension, for me it's just called jre-7u5-linux-x64) and tried running it with:

sudo ./jre-7u5-linux-x64

but I get this error:

./jre-7u5-linux-x64: ./jre-7u5-linux-x64: cannot execute binary file

I have also tried renaming the file to jre-7u5-linux-x64.bin but I get the same error. uname -a shows

Linux ks395362.kimsufi.com 3.2.13-grsec-xxxx-grs-ipv6-64 #1 SMP Thu Mar 29 09:48:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

so I'm on a 64-bit system. The file is executable as confirmed through ls -l

I could install Java through apt-get but I wasn't sure if that's the 32-bit or 64-bit version. If there's a way to install the latest release of Java 64-bit through apt-get could someone let me know?

Mark Twaign

Posted 2012-07-15T17:38:12.550

Reputation: 224

Perhaps the file is corrupt. Try downloading it from java.com again. – None – 2012-07-15T17:41:14.230

I've redownloaded it and tried the process about 5 times now and I've checked the filesize every time. – Mark Twaign – 2012-07-15T17:42:03.340

1Good to hear. Have you changed the permissions of the file to executable? – None – 2012-07-15T17:43:05.833

Yep, the file is executable and I've confirmed that with ls -l – Mark Twaign – 2012-07-15T17:45:18.360

1You need a 64-bit Ubuntu server, not a 32-bit Ubuntu server. Post the output from uname -a to confirm whether you've installed 32-bit or 64-bit Ubuntu. – Michael Hampton – 2012-07-15T17:46:55.097

Here's a link to using apt-get, assuming you are in fact on 64-bit: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html

– None – 2012-07-15T17:48:14.987

Here it is: chris@ks395362:~/css$ uname -a Linux ks395362.kimsufi.com 3.2.13-grsec-xxxx-grs-ipv6-64 #1 SMP Thu Mar 29 09:48:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux – Mark Twaign – 2012-07-15T17:48:40.133

So, Mark, what solved it in the end? – slhck – 2012-07-15T19:57:46.210

Answers

0

The file you downloaded should be an installer. Try running chmod +x ./jre-7u5-linux-x64 before you try to execute it. The command file ./jre-7u5-linux-x64 will tell you what type of file you have.

However, I would recommend installing the Java version available from the installer. The default install on a 64 bit O/S is 64bit Java. As noted in the comments, you will need to add a ppa to get the latest Oracle installer.

BillThor

Posted 2012-07-15T17:38:12.550

Reputation: 9 384