minx
minx

Reputation: 196

JAVA_HOME set to 32bit jdk but java -version shows 64bit

The environment user variable for JAVA_HOME is set to a 32 bit jdk on my machine at-"C:\Program Files (x86)\Java\jdk1.6.0_31" and the PATH includes JAVA_HOME. But when i check java -version from command prompt it shows 64bit version is running.

java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

I need to run 32bit version, is there something i need to change?

Upvotes: 2

Views: 2906

Answers (2)

Seelenvirtuose
Seelenvirtuose

Reputation: 20658

A suggestion how to set the OS environment variables for development tools.

Consider having installed Java, Ant, and Maven. Consider having the following directory structure for these installations:

C:\
 |
 |--- Programs/
 |       |--- Java/
 |       |      |--- jdk7/
 |       |      |     |--- bin/
 |       |      |     |--- <other files and directories>
 |
 |--- Tools/
 |       |--- apache-ant/
 |       |        |--- bin/
 |       |        |--- <other files and directories>
 |       |--- apache-maven/
 |       |        |--- bin/
 |       |        |--- <other files and directories>

Then you should have the following three HOME variables:

JAVA_HOME = C:\Programs\Java\jdk7
ANT_HOME = C:\Tools\apache-ant
M2_HOME = C:\Tools\apache-maven

Your PATH variable then should look like this:

PATH = ...;%JAVA_HOME%\bin;%ANT_HOME%\bin;%M2_HOME%\bin;...

From now on you only need to change the HOME variables when versions change. And your OS always finds the tool you want to start.

Upvotes: 0

wagners
wagners

Reputation: 11

You need to change your PATH variable. JAVA_HOME is a variable normally used by java programms. The PATH variable is used for all kind of executable programms (like java vm).

Upvotes: 1

Related Questions