3

In order to prepare my windows-7 machine for java learning, I want to install the 64-bit jdk version suitable to my amd64 architecture. However, I'm confused about the below things:

[1] I already have a 32-bit jre version, and I can't remove it (since firefox and some other apps are using it), so can a 64-bit jdk co-exist with 32-bit jre on windows-7? What needs to be taken care of for targetting specific platforms for my generated java .classes and .jars?

[2] Since I also want to learn and develop Android apps, would the android-sdk be compatible with 64-bit jdk? If so, what version of jdk will it use?

[3] At Android download site, I don't see separate 32/64 bit downloads for Android-sdk? Does this mean that it will work with both?

In short, what jdk version should I install for all above things to work properly?

Prahlad Yeri
  • 3,425
  • 4
  • 24
  • 49
  • 1
    I'm still not fully convinced as to whether 32/64 bit JDK to be installed. Seems there are some performance differences between both. See http://stackoverflow.com/questions/783662/java-32-bit-vs-64-bit-compatibility – Prahlad Yeri Jun 29 '12 at 11:05

3 Answers3

4

1- Yes they can coexist. You don't need any special configuration.

2- Yes it would. You can specify the version you want in Eclipse. Window > Preferences > Java (Expand) > Installed JREs.

3- Yes.

You can install the latest jdk.

Benito Bertoli
  • 24,408
  • 12
  • 53
  • 61
  • 1
    +1 good answer and depending on OP IDE Netbeans: http://kenai.com/projects/nbandroid/pages/Install and for Eclipse: http://developer.android.com/tools/sdk/eclipse-adt.html 2 good links for incorporating IDE and Android plugin. – David Kroukamp Jun 28 '12 at 12:49
  • I'm still not fully convinced as to whether 32/64 bit JDK to be installed. Seems there are some performance differences between both. See http://stackoverflow.com/questions/783662/java-32-bit-vs-64-bit-compatibility – Prahlad Yeri Jun 29 '12 at 08:47
  • 32-bit can address up to 4GB of memory. If you need more, which I highly doubt, go with 64-bit. – Benito Bertoli Jun 29 '12 at 11:33
  • Thanks Benito for the inputs. Since I have exactly 4 gigs of RAM, I will go with 32-bit. Since Android sdk supports only 32bit, its better to keep the entire toolchain in 32bit to keep things simple. – Prahlad Yeri Jul 01 '12 at 11:40
2

Yeah, Android-sdk is compatible for both 32bit and 64bit systems.

Swayam
  • 16,145
  • 13
  • 62
  • 102
2

so can a 64-bit jdk co-exist with 32-bit jre on windows-7?

It is always recommended to keep one type(version) of JRE in machine.

What needs to be taken care of for targetting specific platforms for my generated java .classes and .jars?

Depending on if you installed the 64-bit or 32-bit JDK it should be in:

32-bit: C:\Program Files (x86)\Java\jdk1.6.0_21\bin
64-bit: C:\Program Files\Java\jdk1.6.0_21\bin

You should be able to edit your PATH environment variable to include that path.

Since I also want to learn and develop Android apps, would the android-sdk be compatible with 64-bit jdk? If so, what version of jdk will it use?

Yes it will be compatible
Make sure you have 64bit Eclipse + 64bit Java. And if i were you then i will always install most recent version of JDK + Eclipse + Android SDK Tool

At Android download site, I don't see separate 32/64 bit downloads for Android-sdk? Does this mean that it will work with both?

AFAIK there is no seperate android tool for 32/64 Bit so it should work.

In short, what jdk version should I install for all above things to work properly?

I will always prefer 32 bit Version of Java + Eclipse.

Make sure if you have installed 32 bit version of java then install 32 version of eclipse. and in case of 64bit version of java install 64bit version of eclipse.

Vipul
  • 31,716
  • 7
  • 69
  • 86
  • "It is always recommended to keep one type(version) of JRE in machine." - are you sure about that? Could you provide any links, etc. cause what I read everywhere else conflicts with this? – Prahlad Yeri Jun 29 '12 at 07:20
  • I just read it on particular blog.Presented My View. – Vipul Jun 29 '12 at 07:26