Cisco ASDM on 64-bit Ubuntu 18.04

     

Most guides tell you to do this:

sudo apt install icedtea-plugin

Or

sudo apt install icedtea-netx

Which is essentially the same thing. But nope, this is what happens then:

net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. The application has not been initialized, for more information execute javaws/browser from the command line and send a bug report.
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:582)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:945)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:576)
    ... 1 more
Caused by: java.lang.ExceptionInInitializerError
    at com.cisco.launcher.s.if(Unknown Source)
    at com.cisco.launcher.Launcher.main(Unknown Source)
    ... 6 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
    at com.cisco.launcher.ClassUtil.<clinit>(Unknown Source)
    ... 8 more

As we already established, Cisco ASDM does not support 64-bit Java. Well guess what, Ubuntu 18.04 does not support 32-bit anymore. So you have to download the 32-bit Java tarball from the official Java download site. Not the RPM version, not the x64 version, the 32-bit tarball. Extract it, then use javaws from the bin subdirectory. But then you get this:

$ /opt/jre32/bin/jcontrol 
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/jre1.8.0_221/lib/i386/libawt_xawt.so: libXrender.so.1: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at java.awt.Toolkit$3.run(Toolkit.java:1636)
    at java.awt.Toolkit$3.run(Toolkit.java:1634)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
    at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
    at java.awt.Component.<clinit>(Component.java:593)

Or this:

$ /opt/jre32/bin/jcontrol 
Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/jre1.8.0_221/lib/i386/libawt_xawt.so: libXtst.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at java.awt.Toolkit$3.run(Toolkit.java:1636)
    at java.awt.Toolkit$3.run(Toolkit.java:1634)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
    at java.awt.Toolkit.<clinit>(Toolkit.java:1670)
    at java.awt.Component.<clinit>(Component.java:593)

Or this:

$ /opt/jre32/bin/jcontrol 
Exception in thread "main" java.lang.Error: Cannot load com.sun.java.swing.plaf.gtk.GTKLookAndFeel
    at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1351)
    at javax.swing.UIManager.initialize(UIManager.java:1459)
    at javax.swing.UIManager.maybeInitialize(UIManager.java:1426)
    at javax.swing.UIManager.getUI(UIManager.java:1006)
    at javax.swing.JPanel.updateUI(JPanel.java:126)
    at javax.swing.JPanel.<init>(JPanel.java:86)
    at javax.swing.JPanel.<init>(JPanel.java:109)
    at javax.swing.JPanel.<init>(JPanel.java:117)
    at javax.swing.JRootPane.createGlassPane(JRootPane.java:546)
    at javax.swing.JRootPane.<init>(JRootPane.java:366)
    at javax.swing.JFrame.createRootPane(JFrame.java:286)
    at javax.swing.JFrame.frameInit(JFrame.java:267)
    at javax.swing.JFrame.<init>(JFrame.java:190)
    at com.sun.deploy.panel.ControlPanel.<init>(Unknown Source)
    at com.sun.deploy.panel.ControlPanel.main(Unknown Source)

So after quite some trial-n-error, this is all you have to install:

sudo apt install libxrender-dev:i386 libxtst-dev:i386 libgtk-3-dev:i386 libcanberra-gtk-module:i386 gtk2-engines-murrine:i386

Then you can finally launch ASDM successfully:

/opt/jre32/bin/javaws https://asa.foobar.com/admin/public/asdm.jnlp

And there you have it!