Install 32bit Java (OpenJDK) on 64bit Ubuntu 12.04

54,981

Solution 1

Juniper used to require Oracle Java, due to a bug in OpenJDK.

Refer : https://github.com/flexiondotorg/oab-java6

to install java.

Solution 2

To answer the original question:

On 12.04 and 12.10, 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-6-jdk:i386 icedtea-6-plugin:i386

And could then successfully log into the VPN.

Since 12.04, Juniper VPN will work on OpenJDK 6 out-of-the-box but only on i386. There was a bug in the icedtea plugin that was preventing this from working previously. I have verified that this is fixed using an i386 Ubuntu 12.04 Live CD.

I am surprised that the amd64 Oracle JDK is working for you. However, I have not yet tested it myself, but when I do I will update this answer. It would be good if you can confirm exactly what packages you are now running.

It is worth noting that there is an optional part to the Juniper VPN login process called the Host Checker that may or may not be configured on the VPN server you are connecting to; it enforces security policies on Windows computers but still has to run on Linux to check what OS you are using. This could result in differing reports of success from different people. For reference, the VPN I use does have the Host Checker enabled.

In your original question you state that you were installing Java 7 packages, yet your log shows you are using Java 6 in Firefox. If you have multiple JDKs installed, you need to be clear which on you are using.

For reference, there is also a very long-running thread on the Ubuntu forums on Juniper VPN.

Update

I have now tested the amd64 Oracle JDK and it wouldn't work for me. So as far as I can see, installing the i386 version of the Oracle JDK or Open JDK is the only way to get it working.

Solution 3

Using the instructions here: http://www.rz.uni-karlsruhe.de/~iwr91/juniper/ I have juniper VPN running on Ubuntu 12.04 64bit with no 32 bit software installed except for these 3 libraries:

sudo apt-get install libc6-i386 lib32z1 lib32nss-mdns

I start the jnc perl script use the --nox option (no gui) and it works great, I use it everyday.

I originally downloaded the cert file using Firefox 64-bit: Tools>PageInfo>Security>View Certificate>details>export

I have since found this script that does the same: https://github.com/udomsak/juniper-ncui/blob/master/getx509certificate.sh

My particular configuration file required host, user, realm, and certfile. Yours may be different.

The certfile location configuration required the full path name, ~ did not expand to /home/username

Share:
54,981
AntonioK
Author by

AntonioK

2018.01 - present, Software Engineer, Google LLC, Kirkland, WA, USA 2013.10 - 2018.01, Software Developer, Epic Systems Corporation, Verona, WI, USA

Updated on September 18, 2022

Comments

  • AntonioK
    AntonioK over 1 year

    I have to run Juniper VPN on the 64bit Ubuntu 12.04. I have installed openjdk-7-jre, openjdk-7-jdk and icedtea-7-plugin. After the browser prompts to install the Juniper VPN, I check it has been successfully installed to "/home/huangyun/.juniper_networks/network_connect".

    I open the Firefox from command line and check the log:

    Launching "/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java" "-classpath" "/home/huangyun/.juniper_networks/network_connect/NC.jar" "NC" "-h" "extranet.scei.a-star.edu.sg" "-L" "0" "-l" "0" "-n" "" "-t" "" "-x"
    

    I run the above command manully:

    $ java -classpath ~/.juniper_networks/network_connect/NC.jar NC -h extranet.scei.a-star.edu.sg -L 0 -l 0 -n "" -t "" -x
    Failed to load the ncui library.
    Quitting.
    

    I check the file libncui.so and found that the .so file is 32-bit version:

    $ file libncui.so 
    libncui.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
    

    I can not recompile the 32-bit .so file to 64-bit, so I think I have to install 32bit Java on 64bit Ubuntu 12.04. Could you please tell me how to do it? I have searched the web but find little information.

    • Admin
      Admin almost 11 years
      Good research to decide that you need the 32-bit java. :)
  • belacqua
    belacqua over 11 years
    Worked for me on 12.10 -- updated answer text to reflect this.
  • Vivek Sharma
    Vivek Sharma about 11 years
    I am using ubuntu-12-10-64. I tried the default sun-java-6, it didnot work. Then I tried the Oracle-7, even then it didnot work. However, in my office, I was able to setup the juniper-vpn-client on a ubuntu-12.04-32bit machine. Any suggestions.
  • ppbitb
    ppbitb about 11 years
    After logging in, Juniper apparently runs some host checking code. My computer was getting stuck on this page. The URL was https://(host on my company's network)/dana/home/starter0.cgi?check=yes I just changed check=yes to check=no and reloaded the page, and everything worked from there!
  • Leo Gallucci
    Leo Gallucci over 10 years
    I tried this first because it was faster than changing to Java 32 bits and IT WORKED! Thanks man.