Installing multiple jdk versions ubuntu 11.0

5,803

It turns out that, all I need to do is download the self extracting 32 bit jdk version package for ubuntu and install it in any location of choice which should be different from the one current 64 bit version is sitting (In my case I put it in /opt/jvm/). Below is a step by step explanation of what I did to make it work.

  1. Download relevant 32 bit version of jdk (I used java jdk-6u32-linux-i586.bin) found here

  2. make it executable by running the following command

    chmod +x jdk-6u32-linux-i586.bin
    
  3. extract this file by simply executing it (Remember it is self extracting). That is run the following command on terminal. (Make sure you are in the directory in which the file is stored).

    ./jdk-6u32-linux-i586.bin 
    

    Note: the contents will be extracted into directory(its name will be jdk1.6.0_32 in this case) which will be created in the current directory.

  4. Copy the directory created in step 3 above into whatever location you want to install the jdk (in my case /opt/jvm). Note that you have to create jvm in opt if it is not yet created. See commands to use below.

    sudo mkdir /opt/jvm
    sudo cp -r jdk1.6.0_32
    
  5. Edit /path-to-where-netbeans-is-installed/netbeans7.1/mobility/WTK2.5.2/bin/emulator and change the variable javapathtowtk to point to newly installed jdk bin directory (that is in my case it is as shown below).

     nano /home/willa/netbeans7.1/mobility/WTK2.5.2/bin/emulator
    
     #!/bin/sh
     javapathtowtk=/opt/jvm/jdk1.6.0_32/bin/
    

Save and exit. And voila enjoy you can now run your applications using WTK2.5.2 emulator.

Share:
5,803

Related videos on Youtube

willa mwanamkana
Author by

willa mwanamkana

What can I say about me? Well as far as ubuntu & linux is concerned I would say I am an enthusiastic open source fan. I dream of a day when I will be able to create my own OS of coz it will be using linux kernel.

Updated on September 18, 2022

Comments

  • willa mwanamkana
    willa mwanamkana over 1 year

    I am starting mobile apps development using java. I have successfully set up netbeans IDE. I want to be able to use the Sun Wireless Toolkit (WTK 2.5.2) emulator to test my applications. However, when I test run my apps, the emulator isn't started.

    A thorough search on the internet indicated that the WTK I am using is targeted for JRE 32 while the one I have in my system is the 64 bit version. The only remedy suggested was to install the jdk 32 bit version and point WTK to that version.

    How do I install the 32 bit version of jdk while at the same time keeping the 64 bit one?

    Below are my specs:

    1. Intel Core i3
    2. Ubuntu 11.10 desktop operation system.
    3. my jdk installation path (64 bit version) /usr/lib/jvm/java-6-openjdk
    
  • nanofarad
    nanofarad over 11 years
    Please include more information on what to do with the .bin file. Execute it? In terminal? Run it through an archiver? Other users may not see enough info in this answer.