How to run java JNLP in Ubuntu 16.04?

Joined
Jun 14, 2011
Messages
528
Hello folks.
First of all, I would like to say that I'm still a n00b in Linux. I've tried to google as much as I can but finally I'm at the dead end.
I'm trying to setup java to run JNLP file (called consult-client.jnlp for this example) in Ubuntu, with Chrome being my default internet browser.
Googling around tells me that I need icedtea-netx to run JNLP in Ubuntu. I installed it but unfortunately, it comes with java8 that my web app doesn't support (it requires older java, such as java7 build 80). Anyway, at this stage, icedtea runs but the web app fails due to java incompatibility.
I've downloaded the older java7 build 80 from oracle archive and manually installed it (had a tough time with this after hours of googling). Also did "update-alternatives" for both java and javaws.

I thought I had correctly installed icetea-netx & install java7, setup java&javaws to use java7 instead of java8, but NO, the web app still fails. This time, upon clicking the JNLP file, nothing happens. When I run the file in terminal, I got an error:
javaws: error while loading shared libraries: libx11.so.6: cannot open shared object file: No such file or directory.
What did I miss?

tF47bT0.jpg

YjGFVsH.jpg

FqZkEJS.jpg
 
its pretty much saying it can't find that shared library, so we have to check is it installed.

what do you get when you do
# ls -l /usr/lib/x86_64-linux-gnu/libX11.so.*
which i believe is the location in for the lib in ubuntu 16.04, and probably later.

if its missing check if you have the package installed
# dpkg -l libx11-6

assuming you have the lib in the right location, you want to check to see what your javaws is linked against.
# ldd /usr/java/jre1.7.0_80/bin/javaws

make sure its running the javaws you expect.
# which javaws
 
Last edited:
its pretty much saying it can't find that shared library, so we have to check is it installed.

what do you get when you do
# ls -l /usr/lib/x86_64-linux-gnu/libX11.so.*
which i believe is the location in for the lib in ubuntu 16.04, and probably later.

if its missing check if you have the package installed
# dpkg -l libx11-6

assuming you have the lib in the right location, you want to check to see what your javaws is linked against.
# ldd /usr/java/jre1.7.0_80/bin/javaws

make sure its running the javaws you expect.
# which javaws
mFOKmUV.png
 
so you notice that it does not see a location for libX11.so.6.
it also looks like javaws is built against 32bit libs, so i am guessing we its 32bit and then we need to check for the 32 bit version of the lib.

check if its 32bit which it looks like it may be
# file /usr/bin/javaws

check if 32bit of lib package is installed
# dpkg -l libx11-6:i386

check path where 32bit of the lib should be
# ls -l /usr/lib/i386-linux-gnu/libX11.so.6*

If its not there i would try a apt-get to get it installed.
# apt-get install libx11-6:i386

If it is install and its in /usr/lib/i386-linux-gnu/ , then maybe its just a library path issue, i would just make a link to where it sees the other libs are.
# ln -s /usr/lib/i386-linux-gnu/libX11.so.6.3.0 /lib32/libX11.so.6.3.0
 
so you notice that it does not see a location for libX11.so.6.
it also looks like javaws is built against 32bit libs, so i am guessing we its 32bit and then we need to check for the 32 bit version of the lib.

check if its 32bit which it looks like it may be
# file /usr/bin/javaws

check if 32bit of lib package is installed
# dpkg -l libx11-6:i386

check path where 32bit of the lib should be
# ls -l /usr/lib/i386-linux-gnu/libX11.so.6*

If its not there i would try a apt-get to get it installed.
# apt-get install libx11-6:i386

If it is install and its in /usr/lib/i386-linux-gnu/ , then maybe its just a library path issue, i would just make a link to where it sees the other libs are.
# ln -s /usr/lib/i386-linux-gnu/libX11.so.6.3.0 /lib32/libX11.so.6.3.0

hgrusers@hgrusers-OptiPlex-360:~$ file /usr/bin/javaws
/usr/bin/javaws: symbolic link to /etc/alternatives/javaws
hgrusers@hgrusers-OptiPlex-360:~$ dpkg -l libx11-6:i386
dpkg-query: no packages found matching libx11-6:i386
hgrusers@hgrusers-OptiPlex-360:~$ ls -l /usr/lib/i386-linux-gnu/libX11.so.6*
ls: cannot access '/usr/lib/i386-linux-gnu/libX11.so.6*': No such file or directory
hgrusers@hgrusers-OptiPlex-360:~$ sudo apt-get install libx11-6:i386

... after installation ...

hgrusers@hgrusers-OptiPlex-360:~$ ls -l /usr/lib/i386-linux-gnu/libX11.so.6*
lrwxrwxrwx 1 root root 15 Sep 18 2015 /usr/lib/i386-linux-gnu/libX11.so.6 -> libX11.so.6.3.0
-rw-r--r-- 1 root root 1348416 Sep 18 2015 /usr/lib/i386-linux-gnu/libX11.so.6.3.0
hgrusers@hgrusers-OptiPlex-360:~$
 
well does it run now that you installed the missing lib?
also run the ldd on javaws again to see if it shows it shows the link to libX11.so.6 now.
 
well does it run now that you installed the missing lib?
also run the ldd on javaws again to see if it shows it shows the link to libX11.so.6 now.
hgrusers@hgrusers-OptiPlex-360:~/Downloads$ ldd /usr/java/jre1.7.0_80/bin/javaws
linux-gate.so.1 => (0xf7edd000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7d77000)
libnsl.so.1 => /lib/i386-linux-gnu/libnsl.so.1 (0xf7d5c000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7d57000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7d02000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7b4c000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7b25000)
/lib/ld-linux.so.2 (0xf7edf000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7b21000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf7b1a000)

Nope. Still doesn't run. Java webstart error :-(
uMbr0XL.png
 
yes, you have another missing lib, this time libXext.so.6, per the error.
# apt-get install libxext6:i386
might as well also install these 32bit libs as you will probably need them too
# apt-get install libxrender1:i386 libxtst6:i386 libxi6:i386
 
yes, you have another missing lib, this time libXext.so.6, per the error.
# apt-get install libxext6:i386
might as well also install these 32bit libs as you will probably need them too
# apt-get install libxrender1:i386 libxtst6:i386 libxi6:i386
Installed those. This time, the java splash logo appeared but that's it. The web app doesn't launch.
Screenshot_from_2018-03-25_19-04-20.png

20180325_190316.jpg
 
This post has been pretty helpful for anyone looking to run a program that's missing dependencies. I went through this same thing a half dozen times on different programs when learning Linux.
 
with no error to go on, you probably will have to go the strace route as 4saken stated, or maybe if you are lucky its writing to a log file some where. if it turns out its an an issue with the actual java at this point that is going to be out side my area of knowledge. maybe you can turn on logging/debugging in java control panel, i would /usr/java/jre1.7.0_80/bin/ to see if the control panel is in there.
 
I didn't think FF and Chrome supported Java at all anymore. Perhaps that's your issue?
 
with no error to go on, you probably will have to go the strace route as 4saken stated, or maybe if you are lucky its writing to a log file some where. if it turns out its an an issue with the actual java at this point that is going to be out side my area of knowledge. maybe you can turn on logging/debugging in java control panel, i would /usr/java/jre1.7.0_80/bin/ to see if the control panel is in there.
I'm a total noob on strace (first time heard of it). Will learn about it.
By the way, is there any common jnlp on the world wide web where the public can test jnlp instead of my company's proprietary web app?

I didn't think FF and Chrome supported Java at all anymore. Perhaps that's your issue?
I doubt so as this is working fine on Windows platform (WinXP and Win7)
 
I am not a big java guy so i can't answer a lot of that. but here are some things you should consider.

1. seems like you are running 64bit version of ubuntu, you might want to install the 64bit version of the jre. I am not saying that the 32bit version isn't going to work, but there is a chance you have other missing libraries since the 32bit ones wont be installed by default, much like how you did not have the 32bit libx11, but the 64bit one was already there.

2. if you look in the jnlp you will see it is just an xml file, this points to where the real code is, the .jar file. are you running this from a place that can reach where ever your company has the jar file?

3. As a test you could use one of these oracle samples, https://docs.oracle.com/javase/tutorial/uiswing/examples/misc/index.html
I was able to get the first one AccessibleScrollDemo.jnlp working with the jre 1.7 that came with the supermicro ipmiview
# ~/IPMIView/jre/bin/javaws AccessibleScrollDemo.jnlp
this opened up the window after i clicked past a few warnings.

4. if strace is beyond your comfort then you could look at increasing the logging with "/usr/java/jre1.7.0_80/bin/jcontrol" advanced tab, there are some debug and logging options you can look in to.
 
Thanks tbg

I removed the current 32-bit java and installed the 64-bit java (from oracle archive).
I tried the AccessibleScrollDemo.jnlp and it's working fine. Yay.
However, when I run my company's web app jnlp, it failed to launch properly with this error:

MissingFieldException[ The following required field is missing from the launch file: <jnlp>]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.LaunchDownload._downloadExtensionsHelper(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadExtensionsHelper(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadExtensions(Unknown Source)
at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
 
you can try lowering the java security setting, run /usr/java/jre1.7.0_80/bin/jcontrol, security tab, medium. your java install may not trust the company's cert. this will rule out that as being the problem.

there is also that XML parse error. If its still a problem after adjusting the security tab, you will have to look in the company's web app jnlp your self at this point. its just an xml file, maybe the formatting got messed up.
you can compare it to the AccessibleScrollDemo.jnlp. just cat the file, there is probably less then 20 lines of real stuff in it.

# cat AccessibleScrollDemo.jnlp
 
you can try lowering the java security setting, run /usr/java/jre1.7.0_80/bin/jcontrol, security tab, medium. your java install may not trust the company's cert. this will rule out that as being the problem.
After setting the security to the lowest (which is medium), the jnlp is launching correctly. Yay. What a huge relief. The jcontrol has to be run in sudo, else the adjustments are greyed out.

I would like to say a million thanks to everyone on this forum for assisting me. While this is a 5 minute job on Windows platform, this is certainly a huge challenge for anyone who's new to Linux. I'm also part to be blamed for installing a 32-bit version of Java on a 64-bit Ubuntu and 64-bit Firefox. Silly me.
 
I would like to say a million thanks to everyone on this forum for assisting me. While this is a 5 minute job on Windows platform, this is certainly a huge challenge for anyone who's new to Linux. I'm also part to be blamed for installing a 32-bit version of Java on a 64-bit Ubuntu and 64-bit Firefox. Silly me.

I gave up on 32 bit under Linux even before official 32 bit support was dumped under the popular distro's, in the end it was just too much trouble regarding dependencies. Bear in mind that a number of situations regarding Windows are also a huge learning curve for anyone that only knows .nix.

Get used to the sudo command, it's the Linux equivalent of UAC (although I think it's honestly a better implementation of UAC once you get used to it - But I never said that!). Good job working through your problem! ;)
 
well, i will say the security setting is a problem that occurs in windows too, and you fix it pretty much the same way, with the security slider in java control panel. But someone not being experienced in linux, can't fault them for not knowing that installing the 32bit version of something could result in missing libs because the 32bit ones aren't installed by default.
 
well, i will say the security setting is a problem that occurs in windows too, and you fix it pretty much the same way, with the security slider in java control panel. But someone not being experienced in linux, can't fault them for not knowing that installing the 32bit version of something could result in missing libs because the 32bit ones aren't installed by default.

Someone who is used to windows, that is. Linux doesn't ship with bloat of unnecessary 32-bit subsystems by default, they have to be installed if needed. One of the reasons why Windows is so vulnerable even today is that it ships with huge amounts of legacy code that still contain unpatched vulnerabilities.
 
I can't believe I didn't see they were using 32bit installers. That is always a recipe for disaster in Linux.
 
I can't believe I didn't see they were using 32bit installers. That is always a recipe for disaster in Linux.

The last time I mucked around with 32bit installers I think I was trying to get Quake running...That was never going to happen!

Having said that, 32bit is legacy now and I'm glad Linux has done away with dated crud.
 
Back
Top