Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I start a JNLP application programmatically?

I have a working JNLP application, but would like to add some end-to-end smoke test.

Is it possible given an URL to download, start and programatically manipulate a JNLP application?

like image 502
Johannes Brodwall Avatar asked Aug 17 '11 13:08

Johannes Brodwall


People also ask

How do I run a JNLP file in Java?

Right-click a JNLP file and click “Open With.” Select the “Java Web Start Launcher” application in the list or click “Browse,” browse to the “C:\Program Files (x86)\Java\jre[version]\bin” folder on your computer and double-click the “Javaws.exe” program file.

How do I run a JNLP file in Windows 10?

Step 1: Right click the JNLP file on your computer and select the Open with option from the prompted menu. Step 2: In the next window, scroll down the options and choose Look for another app on this PC option. Step 3: Then, follow the path below to find javaws.exe.


2 Answers

You can use the javaws tool (part of the JDK) to start a WebStart app. To programmatically manipulate it, you can use any of a number of testing tools and frameworks that simulate user input.

like image 66
Michael Borgwardt Avatar answered Nov 02 '22 05:11

Michael Borgwardt


To start an JNLP application programatically(Linux) you could do something like this:

public static void main(String[] args) throws IOException, InterruptedException {
    String[] cmd = {"/usr/java/jdk1.6.0_17_limpo/jre/javaws/javaws", "/opt/exata/projetosNB/InterfaceVisualizador/dist/launch.jnlp"};
    Process p = Runtime.getRuntime().exec(cmd);
}
like image 21
de.la.ru Avatar answered Nov 02 '22 06:11

de.la.ru