Running 32-bit Firefox with sun-jre in 64-bit Ubuntu [duplicate]

I am trying to run juniper networks connect program to vpn into work and it only works on 32bit sun jre. All the things I have found with google failed so far. I can't use any scripts, like madscientists, as part of the authentication I need to provide some random characters from a grid.

So to isolate this 32bit app install to a corner, I downloaded firefox and jre and unpack them to /opt. I run firefox with sudo as Juniper asks for root password.

Here is Firefox plugins folder

/ot/firefox32/plugins# ls -la
total 8
drwxr-xr-x  2 root root 4096 Mar 11 00:57 .
drwxr-xr-x 11 root root 4096 Mar 10 23:48 ..
lrwxrwxrwx  1 root root   49 Mar 11 00:57 libnpjp2.so -> /opt/java/32/jdk1.6.0_31/jre/lib/i386/libnpjp2.so

Firefox lists sun jre but when check it with "http://java.com/en/download/installed.jsp" it either can't detect java or Firefox freezes

Any Ideas?

Thanks


Note: The description below is valid if you encounter Juniper <7.3 VPN logins. Juniper/Junos 7.3 and upwards should work out of the box with an up to date Ubuntu install.

I am running Ubuntu 12.04/64bits and also stumbled into this problem. For logging into the Juniper VPN via the web-interface at my Clients site I have to supply user/pass/sms-code. So the mad scientists scripts don't work for me either.

I have crafted a slightly different solution for running a 32bit-browser + 32bit Java compared to what psypher246 writes. I have installed a second Firefox browser, a 32 bit version, besides the main 64 bits version installed by package management. Other solutions describe completely removing the 64 bit browser and replacing it with the 32 bit one, but I don't want to do that. Too much time spent getting that browser the way I want it.

This is what I did.

  1. Download a recent java-32 bit tarball from Oracle and unpack it where you want it to be (/opt/java or /usr/lib/jvm whatever). You don't need to do the update-alternatives stuff. Just a JRE should be sufficient.
  2. Download a recent pre-compiled 32 bit version of Firefox. Unpack the tarball where you want it. (unpacked mine just in my home folder).
  3. In the resulting firefox folder, there is a browser folder. Create a plugins folder in there and create a link to libnpjp2.so in the plugins folder. (like ln -s <your-32bit-jre>/lib/i386/libnpjp2.so <your-firefox32bit-location>/firefox/browser/plugins/ )
  4. Now start the 32 bit Firefox version from the shell with -p forcing a profile choice. (cd <your-firefox32bit-location>/firefox and ./firefox -p). Create a new profile to be used with this 32 Firefox. Make sure Firefox will ask for the profile to be used at every startup.
  5. Now with about:plugins in the Firefox address bar you should only see the 32-bit java plugin. With this browser instance, go to the Juniper login page and you should be able to start the VPN session.
  6. You can still start the 64 bit version of Firefox but then select the original (default) profile and the full session with 64 bit plugin's is still there and can be used side by side with the 32 bit Firefox.

The downside of this is that you have to select the correct profile each time you start Firefox, but this can be solved setting default parameters on the command line.


Advantage: Everything is from repositories and keeps up-to-date by the usual updates:

The latest OpenJDK 7 works fine with Juniper VPN. The Sun-jre is not needed any more.

On 12.04 it is possible to install i386 packages on amd64 by appending ":i386" to the package name when running apt-get. So, for example, while running an amd64 Ubuntu 12.04 Live CD, I ran:

sudo apt-get remove firefox openjdk-6-jdk icedtea-6-plugin
sudo apt-get install firefox:i386 openjdk-7-jdk:i386 icedtea-7-plugin:i386

And could then successfully log into the Juniper VPN.

The disadvantage is, Java won't work in other 64bit software like Chrome.


Update: There is no need for 32 bit Firefox in 64bit Ubuntu

From 7.3 onwards, Juniper SA devices support 64-bit Ubuntu for Network Connect.

First, install the 64bit jre/jdk and icedtea

sudo apt-get install openjdk-7-jre icedtea-7-plugin

Second, install the 32bit jre

sudo apt-get install openjdk-7-jre:i386

Note, do not install the 32bit icedtea. Make sure the 64bit is the default java. As long as the 32bit jre exists, Juniper will find the files it needs and run.

Tested on Ubuntu 13.04 64bit.

See Juniper Network Knowledge-base for details.

Also see Juniper setup on 12.04


This issue affects people who use Juniper Network Connect where a username, password AND a secure token is required. The mad scientists scripts do not cater for that token despite claiming it does.

I have recently fixed this problem using Swiftfox 32bit version.

First before trying Swiftfox try: "sudo apt-get install ia32-libs". That might be your missing package.

If not then download Swiftfox from http://getswiftfox.com/download.htm. Click deb files and download the intel prescott file. Install it with: "sudo dpkg -i swiftfox_3.6.13-1_prescott.deb". I created a new java folder to place 32bit java in: "sudo mkdir /usr/java" and unzipped the latest Java 7 32bit file to there: "sudo tar -zxvf jre-7u3-linux-i586.tar.gz -C /usr/java".

Now link the plugin to Swiftfox with: "sudo ln -s /usr/java/jre1.7.0_03/lib/i386/libnpjp2.so /usr/lib/swiftfox/plugins/libnpjp2.so"

After all that Juniper Network Connect works flawlessly although I cannot run Swiftfox 32bit and Firefox 64bit at the same time.

Update: Also check out this answer: 130473

Very simple way to use 32bit Firefox and Java together without doing too much other custom configs