15

I looked at all the other places and I can't figure out how to do it.

How do you type java -version into the console. Because all I get back is that java is not recognized as a command.

I went on the java site and I got the version 1.7.0_45

so I did this

C:\Program Files (x86)\Java\jdk1.7.0_45\bin\javaw.exe

instead of

C:\Program Files (x86)\Java\jre7\bin\javaw.exe

it didn't work either

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -1.7.0_45

It also didn't work.

I've downloaded the most recent android sdk of October 30th from the official site. Help?

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256M
-showsplash
com.android.ide.eclipse.adt.package.product
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm C:\Program Files (x86)\Java\jre7\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40
-Xmx768m
-Declipse.buildId=v22.3.0-887826
-XX:MaxPermSize=512M
cmd
  • 10,795
  • 6
  • 47
  • 59
hubertsng
  • 199
  • 1
  • 2
  • 11
  • Uninstall java full and install it again and please let it install in the default location. It will surely work – Rahul Gupta Dec 24 '13 at 16:01

2 Answers2

22

The problem is that you are trying to start a 64 bit version of Eclipse with a 32 bit version of Java. You can download it from here

Start Eclipse with a 64 bit JVM and the problem will go away.

To do so:

eclipse.exe -vm c:\path\to\64\bit\bin\javaw.exe

You can also update the the first two lines in your eclipse.ini file to use the 64 bit java by default by doing the following:

-vm
c:\path\to\64\bit\bin\javaw.exe

Also, you can also download a 32 bit version of Eclipse for use with 32 bit Java. The key is that the bitness is the same.

cmd
  • 10,795
  • 6
  • 47
  • 59
  • 1
    Thanks it worked. I redirected the -vm to the 64-bit version of the java. Didn't install the 64bit version of Java was my problem. – hubertsng Dec 24 '13 at 17:54
0

You need Java in your bin path - or put in the full pathname.

The easiest way to make sure you have the path correct is to navigate to the folder containing the java exe (i.e. use the cd command in the cmd window, use dir to confirm you are in the correct folder) and then type java -version and java.exe -version there.

By navigating to the folder you have confirmed that you are going to the right location.

Tim B
  • 38,707
  • 15
  • 73
  • 123