I feel like this should just naturally work, but for some reason it isn't. I've gone through the following guide How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE? And it seems that all the help isn't working.
I'm trying to get oracle's 64-bit java to work.
I already installed java using the ppa:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
But then, it downloaded the 32-bit version for some reason:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)
$ java -d64
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.
So I decided to do a manual download. I downloaded the tar.gz file from oracle directly:
jdk-7u79-linux-x64.tar.gz
and was able to extract everything, but for some reason when I try to run java, I get an error.
~/jdk1.7.0_79/bin$ ./java
-bash: ./java: No such file or directory
~/jdk1.7.0_79/bin$ file java
java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=0x68582ab83ddaf6429310a6f841f0adda165ce880, not stripped
So as you see, the file is there, but also not there at the same time. Which is hyper confusing. I next thought that maybe I didn't actually have a 64-bit version of Ubuntu, but I checked and (if I'm reading everything correctly) it looks like I do have 64-bit ubuntu:
$ uname -a
Linux random 4.0.4-x86_64-linode57 #1 SMP Thu May 21 11:01:47 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
Also, I tried the same thing with version 7, and openjdk uses version 7 as well. Both of them did the 32-bit version. You can see all my versions of java here:
$ update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1053 auto mode
1 /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode
2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1052 manual mode
3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1053 manual mode
4 /usr/lib/jvm/jdk1.8.0_05/bin/java 1 manual mode
Any help would be beneficial in order to get 64 bit working on ubuntu. Thanks in advance.
EDIT Turns out uname is not as accurate as I thought. Turns out I am on a 32-bit machine:
$dpkg --print-architecture
i386
$ file /sbin/init
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x07075fcb55b05aeb6286efabba63534fa6ecd213, stripped
dpkg --print-architecture
andfile /sbin/init
.