Note: This guide uses Oracle Java 7. This also may not work if you use SecureID. I have tested this with standard username and password only.

Summary:
Basically, the way I got this to work was to install Oracle Java 7 both 64bit and 32bit versions. Then I install a second Firefox which I am dubbing as 32bit with the 32bit Java plugin soft-linked. I then set the 64bit version of Java as default system-wide and then create a new icon for what I'm calling the 32bit version of Firefox in the launcher. So now, when the 32bit version of Firefox is launched, I'll log into my Juniper VPN website like normal and the 32bit version of Java is used allowing the Juniper client to install and run properly. This probably isn't the best way to do this, but it works quite well.

Preparation:
If using OpenJava, I recommend that you purge your current java install:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Next, install Oracle Java 7:
Code:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Now, download the following:


You should have the following 2 files (versions of course may vary):
  • jre-7u7-linux-i586.tar.gz
  • firefox-15.0.1.tar.bz2


* Note: The following instructions should work with either JDK or JRE. Just make sure to change my commands below appropriately with the correct versions.

Move these two files to a new temp directory on your desktop to make this easier (modify filenames as needed):
Code:
mkdir $HOME/Desktop/temp
cd $HOME/Downloads && mv jre-7u7-linux-i586.tar.gz firefox-15.0.1.tar.bz2 $HOME/Desktop/temp/
cd $HOME/Desktop/temp
Extract Java package and rename each folder appropriately:
Code:
tar -zxvf jre-7u7-linux-i586.tar.gz && mv jre1.7.0_07 jre1.7.0_07_x86
Extract Firefox and rename this appropriately:
Code:
tar -jxvf firefox-15.0.1.tar.bz2 && mv firefox firefox_x86

Installation:
Install the new Oracle Java package and update alternatives:
Code:
sudo mkdir /usr/lib/jvm
sudo mv jre1.7.0_07_x86 /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_07_x86/bin/java 10
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.7.0_07_x86/bin/javaws 10
sudo update-alternatives --install /usr/lib/mozilla/plugins/libnpjp2.so libnpjp2.so /usr/lib/jvm/jre1.7.0_07_x86/lib/i386/libnpjp2.so 10
Note: You want your original 64bit Java to be the current and best alternatives used. Check this by running the following:
Code:
update-alternatives --display java
update-alternatives --display javaws
update-alternatives --display libnpjp2.so
If the link currently points to /usr/lib/jvm/jre1.7_07_x86/*/* as current or best, you want to run the following to make your original 64bit Java the current link:
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-oracle/bin/java 12
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/java-7-oracle/bin/javaws 12
* The higher the priority, the more likely it will be automatically selected as the default Java system-wide

Install Firefox which we'll be using as a 32bit version:
Code:
sudo mv firefox_x86 /opt/
sudo cp /usr/share/applications/firefox.desktop firefox_x86.desktop
sudo gedit /usr/share/applications/firefox_x86.desktop
Copy and paste the following and save:
Code:
[Desktop Entry]
Version=1.0
Name=Firefox Web Browser (32-bit)
Comment=Browse the World Wide Web
GenericName=Web Browser
Keywords=Internet;WWW;Browser;Web;Explorer
Exec=/opt/firefox_x86/firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;
StartupWMClass=Firefox
StartupNotify=true
Actions=NewWindow;
Name[en_US]=Firefox Web Browser (32-bit)

[Desktop Action NewWindow]
Name=Open a New Window
Exec=/opt/firefox_x86/firefox -new-window
OnlyShowIn=Unity;

Press your SUPER key (Windows Key) and search for "Firefox".
  • You should see 2 entries now, "Firefox Web Browser" & "Firefox Web Browser (32-bit)"
  • Grab the icon for the 32bit version and place it in the Unity Launcher. Now you have a quicklink to launch the 32-bit version of Firefox.


All that's left is to associate the 32bit version of Java with the 32bit version of Firefox:
Code:
sudo ln -s /usr/lib/jvm/jre1.7.0_07_x86/lib/i386/libnpjp2.so /opt/firefox_x86/plugins/

Testing:
If you'd like to test this, just go to this site: http://www.java.com/en/download/testjava.jsp
  • Open up your normal Firefox and go to the link. You should see the version is 64bit.
  • Test the other browsers you have as well.
  • Now, open up the 32bit version of Firefox and go to the link. You should now see the version is 32bit.


To use Juniper VPN now, just log into your VPN website like normal with the 32bit version of Firefox and you should get a prompt to install the Juniper client.
  • Click "Yes"
  • Type your password when prompted in a separate Terminal window.
  • If everything was successful, you should now have Juniper VPN running and connected.
Troubleshooting Tips:
If when you log in to your VPN website and the Juniper client pops up very briefly and closes instantly, try the following:
  • Sign out of your VPN website and close all versions of Firefox.
    Code:
    rm -rf $HOME/.juniper_networks
  • If that didn't work, do the following:
    • Sign out of your VPN website and close all versions of Firefox.
      Code:
      rm -rf $HOME/.juniper_networks
      sudo dpkg-reconfigure resolvconf
      sudo reboot