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?

8
  • Perhaps the file is corrupt. Try downloading it from java.com again.
    – user3463
    Jul 15, 2012 at 17:41
  • I've redownloaded it and tried the process about 5 times now and I've checked the filesize every time. Jul 15, 2012 at 17:42
  • 1
    Good to hear. Have you changed the permissions of the file to executable?
    – user3463
    Jul 15, 2012 at 17:43
  • Yep, the file is executable and I've confirmed that with ls -l Jul 15, 2012 at 17:45
  • 1
    You 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. Jul 15, 2012 at 17:46

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .