1

Due to the new license of OracleJDK8, I have to use OpenJDK8. I have installed AdoptOpenJDK8 from Homebrew and it works well.

The problem is that I have to launch a Java application from a JNLP link, what is called Java Web start. The problem is that this feature is not included in the OpenJDK8.

Java Web Start is implemented in the project IcedTea-Web but I cannot find any binaries for macOS and find I try to build it, I obtain the message:

configure: error: "OS darwin18.2.0 is not supported"

My question is : How can I run a JNLP file with OpenJDK 8? Do I need to use IcedTea-Web and if yes how to build it?

1

IcedTea-Web is a project that:

provides a Free Software web browser plugin running applets written in the Java programming language and an implementation of Java Web Start, originally based on the NetX project.

but there is no build for macOS. However the important part of this application is written in Java so we can run it directly on macOS. Here is how:

Get the Debian build from the stable release:

wget http://ftp.us.debian.org/debian/pool/main/i/icedtea-web/icedtea-netx-common_1.6.2-3.1_all.deb

Extract the deb file:

tar xzvf icedtea-netx-common_1.6.2-3.1_all.deb

Extract the archive data.tar.xz which is inside the deb file:

tar xzvf data.tar.xz

Go to the directory where the main jar file is:

cd usr/share/icedtea-web/

and just run your jnlp file:

java -cp netx.jar net.sourceforge.jnlp.runtime.Boot -Xnofork -jnlp my_application.jnlp

Depending on your application you could have to change options. You can list them with:

java -cp netx.jar net.sourceforge.jnlp.runtime.Boot

which result in:

SYNOPSIS
    javaws [-run-options] jnlp file
    javaws [-control-options]

OPTIONS
    When specifying options, the name of the jnlp file can be after the command, the -jnlp option, an option with no arguments, or after an argument with an option that takes one argument. A html file that launches a jnlp can be specified after the -html option.
    The jnlp-file can either be a url or a local path.
    The JNLP file should only be specified once, whether as a main argument, after -jnlp or through an html file.
    Control options:
    -about               - Shows a sample application.(No argument expected)
    -help                - Prints out information about supported command and basic usage.(No argument expected)
    -license             - Display the GPL license and exit.(No argument expected)
    -viewer              - Shows the trusted certificate viewer.(No argument expected)
    -Xclearcache         - Clean the JNLP application cache.(No argument expected)
    Run options:
    -allowredirect       - Follows HTTP redirects.(No argument expected)
    -arg arg             - Adds an application argument before launching.(Expected one or more arguments)
    -headless            - Disables download window, other UIs.(No argument expected)
    -html                - Location of HTML file to launch (url or file). You can use parameter ALL  or numbers (like 1 2 5) to select applets on page. However experimental, this switch should keep you still in safety.(Expected one or more arguments)
    -jnlp                - Location of JNLP file to launch (url or file).(Exactly one argument expected)
    -nosecurity          - Disables the secure runtime environment.(No argument expected)
    -noupdate            - Disables checking for updates.(No argument expected)
    -param name=value    - Adds an applet parameter before launching.(Expected one or more arguments)
    -property name=value - Sets a system property before launching.(Expected one or more arguments)
    -strict              - Enables strict checking of JNLP file format.(No argument expected)
    -update seconds      - Check for updates.(Exactly one argument expected)
    -verbose             - Enable verbose output.(No argument expected)
    -version             - Print the IcedTea-Web version and exit.(No argument expected)
    -Xignoreheaders      - Skip jar header verification.(No argument expected)
    -xml                 - Uses a strict XML parser to parse the JNLP file.(No argument expected)
    -Xnofork             - Do not create another JVM.(No argument expected)
    -Xoffline            - Prevent ITW network connection. Only cache will be used. Application can still connect.(No argument expected)
    -Xtrustnone          - Instead of asking user, will foretold all answers as no.(No argument expected)
  • 1
    Nice suggestion, +1! I only get a few hundreds of typical java exceptions but I believe that is normal. I am trying to run it on windows and although it's java and should be able to run on every platform that has a jre... – Giuseppe Jan 22 at 10:35
  • java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\<myuser>\.config\icedtea-web\security\java.policy at java.base/java.net.URI$Parser.fail(URI.java:2915) at java.base/java.net.URI$Parser.parseAuthority(URI.java:3249) ... – Giuseppe Jan 22 at 10:38
  • 1
    Note that this is a best-effort reverse engineering of the Oracle implementation not sharing any sources. This mean that it will behave slightly differently. It is important however, we need a good launcher implementation. – Thorbjørn Ravn Andersen Feb 22 at 21:18

You must log in to answer this question.

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