How do I pass JNLP command arguments from a file?

Article ID:360035199311
1 minute readKnowledge base

Issue

We want to be able to launch a JNLP agent using command line options, nevertheless when the agent is running others could get connection information that we would prefer to hide from a ps command execution.

Resolution

As described in one of the comments inside JENKINS-18342, we can create a file where each entry shown below must be in a different line:

params.txt

-jnlpUrl
https://somewhere/xx.jnlp
-secret
<SECRET>

Once that we save this file as params.txt we should be able to invoke the agent using the syntax shown below:

java -jar agent.jar @params.txt
This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.