When configuring Jenkins nodes, the absence of the "Launch slave agents via Java Web Start" option (JNLP) can be particularly frustrating for pipeline setups. The standard alternatives like "Launch agent via execution of command on the master" don't provide the same flexibility for distributed builds.
First, verify these essential components:
# Check Java Web Start installation
ls -l /usr/bin/javaws
which javaws
# Jenkins JNLP port configuration (default 50000)
netstat -tulnp | grep 50000
The solution typically involves these adjustments:
- Navigate to Manage Jenkins → Configure Global Security
- Under Agents, ensure "TCP port for JNLP agents" is set to Fixed with value 50000
- Check "Enable Agent → Master Access Control"
- Install the JNLP Agent plugin if missing
For Jenkins instances managed as code:
import jenkins.model.Jenkins
import hudson.security.*
// Configure JNLP port
Jenkins.instance.setSlaveAgentPort(50000)
// Save configuration
Jenkins.instance.save()
If the option still doesn't appear:
- Restart Jenkins after configuration changes
- Verify firewall rules allow TCP/50000
- Check Jenkins logs for JNLP-related errors
- Test Java Web Start manually with:
javaws -verbose http://jenkins-server/jnlpJars/agent.jar
When configuring Jenkins nodes, the absence of the "Launch slave agents via Java Web Start" option typically indicates one of these scenarios:
- JNLP (Java Network Launch Protocol) ports are not properly configured
- Required plugins are missing or outdated
- Java Web Start (javaws) is not properly recognized by Jenkins
First, check these critical components on your Jenkins master:
# Check Java Web Start installation
ls -l /usr/bin/javaws
which javaws
# Verify Jenkins JNLP port configuration
curl -s http://localhost:8080/configure | grep -A5 "TCP port for JNLP"
Follow this comprehensive approach to restore the missing option:
1. Configure JNLP Port in Global Security
Navigate to Manage Jenkins > Configure Global Security and ensure:
- "TCP port for JNLP agents" is set to Fixed with value 50000
- "Agent protocols" includes JNLP-connect and JNLP2-connect
2. Install Required Plugins
Verify these plugins are installed and updated:
# Recommended plugin list
jenkins-plugin-cli --plugins \
matrix-auth:3.1.5 \
ssh-slaves:1.32.0 \
windows-slaves:1.8
3. Java Web Start Configuration
For Linux systems, ensure proper symlinks:
# Create symbolic link if missing
sudo ln -s $(update-alternatives --list javaws) /usr/bin/javaws
# Verify Java version compatibility
java -version
javaws -version
If the option still doesn't appear, consider these workarounds:
Manual JNLP Launch
You can manually launch agents using this command:
java -jar agent.jar -jnlpUrl http://jenkins-server:8080/computer/node-name/slave-agent.jnlp \
-secret your-secret-key \
-workDir "/path/to/agent/work"
SSH Connection Method
As a fallback, configure SSH connection with proper credentials:
// Jenkinsfile example for SSH agent
pipeline {
agent {
label 'ssh-node'
}
stages {
stage('Example') {
steps {
sh 'echo Running on SSH agent'
}
}
}
}
- Check Jenkins logs:
tail -f /var/log/jenkins/jenkins.log | grep -i jnlp
- Verify firewall settings for JNLP port (default 50000)
- Test Java Web Start independently:
javaws -viewer