14

I have downloaded some application samples that have .jnlp extension. Actually, these are small JavaFX applications. And .jnlp should be run with Java Web Start.

Now, I have Xubuntu, jdk 1.7, Iced Tea Web Start installed, and when I try to open some of these applications in browser (I suppose Web Start should load), nothing happens. Am I missing something, or how else can I start .jnlp application on linux?

2
  • See to the same question. Feb 15, 2014 at 23:05
  • @DozortsevAnton Thanks, but didn't help. I am not able to open .jnlp file not even from terminal. Btw, I have Open JDK 1.7, and as I have read on some other sites this issue is common with Open JDK Java. And with Oracle Java it should work. I will install Oracle Java later, don't have time now.
    – Vladimir
    Feb 16, 2014 at 0:46

3 Answers 3

16

In order to run a Java Network Launching Protocol (JNLP) you need to have the Java Web Start (JavaWS) software installed on your system. To verify, open the terminal and type:

javaws

At least for Debian-based Linux distribuitions, JavaWS is included within the icedtea-netx package. To install it using apt (package manager):

sudo apt install icedtea-netx

Some java dependencies might be needed. If so, apt will prompt you to.

Having every thing installed properly, just run:

javaws file.jnlp
1
  • The current icedtea package is icedtea-web
    – hynekcer
    Aug 9, 2021 at 16:27
2

To do so, the most easy is to download the Java Runtime package from Oracle corporation (today's version is Version 8 Update 361):

For the english standard package at the time I'm writing (2023-03-12), go on java download page and copy the link for your system (here in the example I'm using the x86_64 archive. You must use the link you copy on the java download page, not the one in this post ): java download

After, go to /usr/lib/jvm folder and extract the package : Here is a full example for downlaoding, extracting ...

$ cd download
$ wget -O jre-8u361-linux-x64.tar.gz https://javadl.oracle.com/webapps/download/AutoDL?BundleId=247938_0ae14417abb444ebb02b9815e2103550
--2023-03-12 12:11:30--  https://javadl.oracle.com/webapps/download/AutoDL?BundleId=247938_0ae14417abb444ebb02b9815e2103550
Resolving javadl.oracle.com (javadl.oracle.com)... 104.108.60.58, 2a02:26f0:9100:13a8::3311, 2a02:26f0:9100:139e::3311
Connecting to javadl.oracle.com (javadl.oracle.com)|104.108.60.58|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://sdlc-esd.oracle.com/ESD6/JSCDL/jdk/8u361-b09/0ae14417abb444ebb02b9815e2103550/jre-8u361-linux-x64.tar.gz?GroupName=JSC&FilePath=/ESD6/JSCDL/jdk/8u361-b09/0ae14417abb444ebb02b9815e2103550/jre-8u361-linux-x64.tar.gz&BHost=javadl.sun.com&File=jre-8u361-linux-x64.tar.gz&AuthParam=1678620691_2c78701ea65b58997f0629935ba907e4&ext=.gz [following]
--2023-03-12 12:11:31--  https://sdlc-esd.oracle.com/ESD6/JSCDL/jdk/8u361-b09/0ae14417abb444ebb02b9815e2103550/jre-8u361-linux-x64.tar.gz?GroupName=JSC&FilePath=/ESD6/JSCDL/jdk/8u361-b09/0ae14417abb444ebb02b9815e2103550/jre-8u361-linux-x64.tar.gz&BHost=javadl.sun.com&File=jre-8u361-linux-x64.tar.gz&AuthParam=1678620691_2c78701ea65b58997f0629935ba907e4&ext=.gz
Resolving sdlc-esd.oracle.com (sdlc-esd.oracle.com)... 23.212.156.99, 2a02:26f0:9100:185::b3b, 2a02:26f0:9100:18c::b3b
Connecting to sdlc-esd.oracle.com (sdlc-esd.oracle.com)|23.212.156.99|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 97071671 (93M) [application/x-gzip]
Saving to: 'jre-8u361-linux-x64.tar.gz'

jre-8u361-linux-x64.tar.gz 100%[======================================>]  92.57M   202MB/s    in 0.5s    

2023-03-12 12:11:31 (202 MB/s) - 'jre-8u361-linux-x64.tar.gz' saved [97071671/97071671]

Verify you have download the package and go to /usr/lib/jvm to extract the tarball

$ ls -lh jre-8u361-linux-x64.tar.gz 
-rw-r--r-- 1 nba nba 93M Jan  9 19:30 jre-8u361-linux-x64.tar.gz
$ cd /usr/lib/jvm
/usr/lib/jvm$ sudo tar -zxf  ~/download/jre-8u361-linux-x64.tar.gz

Verify the package is sucessfully extracted :

$ ls -l | grep jre1.8.0_361
drwxr-xr-x 1 root  root  244 Mar 12 12:15 jre1.8.0_361

And verify you have all JRE binaries :

$ cd jre1.8.0_361/bin/
$ ls -l
total 464K
lrwxrwxrwx 1 10143 10143    8 Jan  9 09:40 ControlPanel -> jcontrol
-rwxr-xr-x 1 10143 10143 8.6K Jan  9 09:40 java
-rwxr-xr-x 1 10143 10143 146K Jan  9 09:40 javaws
-rwxr-xr-x 1 10143 10143 6.2K Jan  9 09:40 jcontrol
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 jjs
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 keytool
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 orbd
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 pack200
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 policytool
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 rmid
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 rmiregistry
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 servertool
-rwxr-xr-x 1 10143 10143 8.7K Jan  9 09:40 tnameserv
-rwxr-xr-x 1 10143 10143 183K Jan  9 09:40 unpack200

Now you can launch JNLP files with javaws program:

/usr/lib/jvm/jre1.8.0_361/bin/javaws ~/download/jviewer.jnlp

If you want Firefow launch directly JNLP files, go to Firefox preferences and search "type". It will list all file type and the associated action to do. For JNLP files, edit the property and select custom program. Il will open your system browser and then, select : /usr/lib/jvm/jre1.8.0_361/bin/javaws

save and you're done.

This next part is not mandatory and is just an extend to the answer:

for those who wanted to manage the system default JRE environment, you can do it with "alternatives"

$ sudo update-alternatives --list javaws
update-alternatives: error: no alternatives for javaws

We will create an alternative for javaws (you can also do it for java, jcontrol, and all binaries that are in the bin/ directory)

$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.8.0_361/bin/javaws 0 
update-alternatives: using /usr/lib/jvm/jre1.8.0_361/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode

With alternatives, you can install different version of java for example :

$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.8.0_291/bin/javaws 1
update-alternatives: using /usr/lib/jvm/jre1.8.0_291/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode

Verify

$ sudo update-alternatives --list javaws
/usr/lib/jvm/jre1.8.0_291/bin/javaws
/usr/lib/jvm/jre1.8.0_361/bin/javaws

Now we will see how to modify an alternative :

$ sudo update-alternatives --config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                  Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/jre1.8.0_291/bin/javaws   1         auto mode
  1            /usr/lib/jvm/jre1.8.0_291/bin/javaws   1         manual mode
  2            /usr/lib/jvm/jre1.8.0_361/bin/javaws   0         manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jre1.8.0_361/bin/javaws to provide /usr/bin/javaws (javaws) in manual mode

Here we've juste select the last alternative '2' to use the first version (361) we have download on java.com Verify :

$ sudo update-alternatives --config javaws
There are 2 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                  Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/jre1.8.0_291/bin/javaws   1         auto mode
  1            /usr/lib/jvm/jre1.8.0_291/bin/javaws   1         manual mode
* 2            /usr/lib/jvm/jre1.8.0_361/bin/javaws   0         manual mode

Press <enter> to keep the current choice[*], or type selection number: 
$

We're done ! Now your selected alternative is the program your system will use to provide

/usr/bin/javaws 

It also work with older version of JAVA like JRE 1.6 or JRE 1.7

You must also notice that java security and exception can be modify with 'jcontrol' command (jcontrol binary is in the same directory with 'java' and 'javaws' )

0

From what I understand, a JNLP file is essentially an XML file with a link to the JAR file.

If you are unwilling to install other packages and simply want to run the program, just

  • open the JNLP file in a text editor and find the link (or cat app.jnlp | grep href),
  • download the .jar file associated with the homepage and the link (using wget for example),
  • then java -jar app.jar.

See https://stackoverflow.com/questions/11594047/how-to-get-jar-file-from-jnlp-file for more information.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .