Java Webstart

From OpenMBD
< CI
Jump to: navigation, search


Back to Home


www.java.com

Introduction to Java Webstart

Java webstart is a way to start a Java application right from your webbrowser without the need for installing. It is being used by Jenkins in order to be able to communicate with slave machines. In other words, the Jenkins master can communicate with it's slave machines via the Jenkins slaves. Those slaves in fact are Java Webstart applications. More information about Java Webstart can be found on the Oracle website.


Installation

Although installation is not required, it would be very convenient to configure your slave machines in such a way that the Java Webstart application is started after booting your slave machine. (either a separate machine which can be reached via the network or a virtual machine) Otherwise it should be started manually after each reboot by accessing the main Jenkins page and navigate to the corresponding slave node.

In order to be sure your slave machines gets connected to the Jenkins master in order to be available to execute jobs, the following steps can be followed:


    Setup your Jenkins webstart folder
  1. Log in to your slave machine
  2. Create a new folder named JenkinsSlave and create an empty textfile in it called startupJenkinsSlave.txt
  3. Open the textfile and type cd on the first line, followed by a space
  4. Copy the file path and paste it after "cd "
  5. Open a webbrowser and navigate to your Jenkins webpage
  6. Log in to Jenkins and navigate to the slave node which should run on your machine (No slave node configured yet? Go to wiki.jenkins.io for a step-by-step guide)
  7. Copy the command under "Run from agent command line: " to your clipboard.
  8. Paste it into startupJenkinsSlave.txt, under the line cd <yourfilepath> Save the change
  9. Change the file extension of startupJenkinsSlave.txt to startupJenkinsSlave.bat. Possibly you would have to accept a windows prompt
  10. Go to your downloads folder and relocate the file slave-agent.jnlp to the folder containing startupJenkinsSlave.bat
  11. Schedule a task to run the Java Webstart application and connect the Jenkins slave to the Jenkins master on startup

  12. Open Windows Task Scheduler (search in windows start menu) and click create basic task...
  13. Give it a name like startupJenkinsSlave
  14. When asked when to start the task, select "when the computer starts"
  15. When asked what action to perform, select "Start a program"
  16. Click the browse button and navigate to the file startupJenkinsSlave.bat
  17. Review your settings and click "Finish"

Configuration

Once the slave machine has been setup properly and is online, it can be used by Jenkins to execute tasks. The slave machine will be visible in the Jenkins dashboard as a so-called slave-node. Several settings are available to configure this node according to your likings.

The Jenkins wiki environment already contains extensive information in how to configure and set-up your slave nodes. More information on distributed builds can be found on wiki.jenkins.io.