Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I have 64 bit Java, but no jdk folder in my Program Files\Java folder?

I'm trying to set the JAVA_HOME environment variable - I need to set it to the 64 bit version.

To make sure I have the 64 bit version, I checked java -version by the cmd prompt, and got the output:

Java version "1.7.0_25" 
Java<TM> SE Runtime Environment <build 1.7.0_25-b17>
Java Hotspot<TM> 64-bit Server VM <build 23.25-b01, mixed mode>

I'm assuming the last line verifies I have 64-bit... so I went to check the exact path to type into the environment variable, and found that Program Files\Java\ does not contain a jdk folder. However, Program Files (x86)\Java\ does. Instead, the former only has a jre7 folder.

I can't direct my environment variable to the 32-bit folder because Android Studio keeps telling me that I need 64-bit java. What am I missing?

(If this belongs on SuperUser and not here, just comment below and i'll delete the question here)

like image 512
u3l Avatar asked Mar 05 '14 03:03

u3l


2 Answers

I think you are looking at JRE

type

javac -version

in your command line

like image 113
user3381763 Avatar answered Nov 03 '22 01:11

user3381763


You can have multiple Javas installed. Sounds like you have a 32 bit JDK and a 64 bit JRE. 64 bit software is installed in the "program files" folder, and 32 bit software is installed in the "program files (x86)" folder.

a 64 bit JDK will live in /program files/java/jdkxxx

Download the 64 bit JDK installer and install it, and then point your JAVA_HOME to it.

The installer takes care of this so far as I remember, but you will want to modify your PATH variable as well to point to %JAVA_HOME%/bin; ... add that to the front of the path so that typing Java will find your JDK first.

like image 36
Paul Becotte Avatar answered Nov 03 '22 01:11

Paul Becotte