Running Java Web Start apps on Ubuntu Linux for AMD 64

I love Java Web Start.  I think it does a very good job of solving many of the Java distribution issues.  It supports automatic updating of apps at the jar level, including dependencies.  It really makes life easy for the end user, and really is pretty easy to implement for the developer.

But, if you are running Ubuntu Linux for AMD64 like I am, it won't work out of the box with the 64 bit JVM.  For whatever reason, Sun hasn't ported it.  Not that I'm complaining.  Now that Sun freed Java, we all have no one to blame but ourselves.

First, let me say, there are more issues for Beryl/Compiz users.  The information below won't help you.  I'll cover running Swing and Java Web Start on Beryl in a separate post later this week.

The solution is to install the 32 bit Java 1.5.  I realize Java 1.6 is available, but it won't work for some reason (I couldn't really tell why, the app just never comes up, but shows no errors).  The installation is pretty simple.  Just run:

sudo apt-get install ia32-sun-java5-bin

Then, you can launch Java web start apps using:

/usr/lib/jvm/ia32-java-1.5.0-sun/bin/javaws http://argouml-downloads.tigris.org/jws/argouml-0.24.jnlp

That example uses ArgoUML .24 but you can easily adjust.

Wrapper Script

You may not want to have to remember all that every time.  I have an easy fix.  Create a wrapper script:

sudo gedit /usr/local/bin/javaws

In the script place:

#! /bin/sh
/usr/lib/jvm/ia32-java-1.5.0-sun/bin/javaws $1

Or, you can just download mine.  Just make sure to set it as executable:

sudo chmod +x /usr/local/bin/javaws

Firefox Integration

In Firefox, when you click on a Java Web Start link, it will prompt you.  You can tell it to open with  /usr/lib/jvm/ia32-java-1.5.0-sun/bin/javaws or simply "javaws" if you created the wrapper script.  You can also check the "Do this automatically..." checkbox.  From that point on, .jnlp links will just work.

  1. richard (not verified)
    Fri, 03/23/2007 - 12:30am
    ok did all that you suggested and it still will not work with ivocalize software in firefox ie lauch.jnlp Any ideas?
  2. dmartin
    Fri, 03/23/2007 - 11:17pm

    You'll have to provide more information.  What's happening when you try to launch it?  If you see nothing, try this:  Right click on the link and chose "Copy Link Location".  Then, from the command line paste the link after javaws, like so "javaws http://www.example.com/link/link.jnlp".  Tell me if you get errors.

  3. David Little (not verified)
    Wed, 07/25/2007 - 4:52pm
    Thank you, thank you, thank you for this post.
  4. Gordy (not verified)
    Fri, 08/10/2007 - 1:16pm
    Great post! Thanks very much. Followed your instructions and they worked perfectly.
  5. Josh (not verified)
    Thu, 10/11/2007 - 7:43pm
    Now in Ubuntu Gutsy the ia32-sun-java6-bin package does the trick automatically! Hooray!
  6. Anonymous (not verified)
    Fri, 02/15/2008 - 10:17pm
    Thank you! Worked for the Quaqua demo very nicely on Ubuntu 7.10 AMD64 + Firefox 2.0.0.12
  7. Anonymous (not verified)
    Sun, 03/30/2008 - 3:00am
    You da man Dan :) Thanks
  8. Anonymous (not verified)
    Mon, 04/14/2008 - 9:47am
    Thank you very much!!! It worked like a charm with 64 Kanotix and Java 6 JERRY
  9. pbhj (not verified)
    Mon, 04/21/2008 - 11:00am
    Sorry but didn't work for me on Ubuntu 7.10 user@localhost:~$ /usr/lib/jvm/ia32-java-1.5.0-sun/bin/javaws http://www.randelshofer.ch/quaqua/jws/quaqua-test.jnlp Java Web Start splash screen process exiting ..... Splash: sysCreateListenerSocket failed: No such file or directory
  10. Anonymous (not verified)
    Wed, 05/21/2008 - 9:32am
    Oh, you save me a lot of frustration... thanks so much.
  11. Szabo Zoltan (not verified)
    Fri, 05/30/2008 - 6:16am
    I'm on Hardy Heron AMD64, firefox3 beta, when I click the webstart icon it starts, asks me if to create sortcuts, then dies with error: /usr/share/themes/Clearlooks/gtk-2.0/gtkrc:41: error: lexical error or unexpected token, expected valid token....Cannot find any provider supporting DES/ECB/PKCS5Padding thanks
  12. obrys (not verified)
    Sun, 06/01/2008 - 4:51pm
    Nice post but I prefer setting the wrapper up by update-alternatives so whole workaround is:
    sudo apt-get install ia32-sun-java5-bin
    sudo update-alternatives --config javaws
    
    and choose /usr/lib/jvm/ia32-java-1.5.0-sun/jre/bin/javaws

    Obrys

  13. Obrys (not verified)
    Mon, 06/02/2008 - 5:09am
    It solves the problem only partialy. Applications are started using java5 not 6.
  14. jimothy (not verified)
    Fri, 06/20/2008 - 10:30am
    Try: sudo apt-get install sun-java6-jre or sudo apt-get install sun-java6-jdk (I'm running this now; 20 minutes to go!)
  15. dmartin
    Tue, 06/03/2008 - 12:41am
    update-alternatives is automatically run when you install the ia32-java5 package. But, as I allude to above, just because you want to fix Java WS doesn't mean you want to run ALL Java programs under 32-bit Java 5. Which is the point of the javaws wrapper.
  16. Anonymous (not verified)
    Thu, 10/02/2008 - 7:35pm
    Nice!! Thanks you, I always use the latest JDK...this working for me.
  17. ombra32 (not verified)
    Wed, 10/08/2008 - 3:13am
    Thanks a lot!! ombra32
  18. ombra32 (not verified)
    Wed, 10/08/2008 - 3:45am
    I've translated it in italian on my blog, and cited yours..thanks!! http://ombra32.blogspot.com/2008/10/ubuntu-804-e-i-file-jnlp-64bit.html ombra32
  19. ombra32 (not verified)
    Wed, 10/08/2008 - 3:46am
    I've translated it in italian on my blog, and cited yours..thanks!! http://ombra32.blogspot.com/2008/10/ubuntu-804-e-i-file-jnlp-64bit.html ombra32
  20. Lex V. Ross (not verified)
    Tue, 10/21/2008 - 10:32am
    I have followed your tutorial, and when running the application, Java gives me an error message on login saying "Cannot connect to server". When I reboot into 32-bit system then everything works fine but not on 64-bit Hardy. If I use 64-bit Open JDK supplied with Hardy it logs in fine and then waits forever for server to reply on retrieving my account information. So I desperately need this Java Web Start to operate. I have checked 32-bit Java Console network settings and they are correct. Any ideas? Thanks!
  21. Taro (not verified)
    Mon, 12/15/2008 - 2:34am
    Ubuntu Documentation says that to run 32 bit Java you have to install 32 bit Firefox for AMD64. Is that what you guys did or anyone using 64 bit Firefox and work?
  22. arnab (not verified)
    Fri, 10/31/2008 - 9:14am
    thank you for this information, it worked for me also
  23. Anonymous (not verified)
    Fri, 11/21/2008 - 4:57pm
    its now working.. but the prob is when i maximize my window, the uncovered portion won't get repainted..
  24. William Dupré (not verified)
    Tue, 12/30/2008 - 4:53pm
    THANKS a lot !!!! Works like a charm ..... Happy new year to you.
  25. Carlos Rodriguez (not verified)
    Tue, 06/09/2009 - 3:13am
    Thanks!!! that worked! What I do:
    $ sudo apt-get install ia32-sun-java6-bin
    $ sudo gedit /usr/bin/javaws
    I commented all with # at the beginning of each line and added at the end:
    /usr/lib/jvm/ia32-java-6-sun/bin/javaws $1
    Last, I did what you recommended at "Firefox Integration"

    Box: Athlon 64 running Ubuntu 64bits Hardy 8.04

  26. JoshC (not verified)
    Wed, 10/28/2009 - 2:33pm
    Wow thanks for the great advices. I was afraid that I will never run Java on my old AMD 64 computer, but now everything works fine! I can start programming using my lovely Java web start. By the way it is really very easy to develop some simple applications using Java web start. Thanks one more time for the useful advices, I think that without you I would never run Java on my old Pc. Sincerely, Josh Cliffson from java software development
  27. Liam Thompson (not verified)
    Fri, 11/27/2009 - 5:01am
    Thanks Dan, this has really helped me. I needed to run a JNLP file with Java5, but I could not get it to run, even if I installed the 64bit JavaRE5 for Linux which is quite odd. Anyway, thanks for the post