I have the working /.jenkins folder under a specific user in home on Linux. I want to start Jenkins with another user, but re-use the .jenkins folder of the other user. How
I think this can help you out.
Set an Environment Variable JENKINS_HOME pointing to the .jenkins folder and run the Jenkins command.
export JENKINS_HOME=/usr/jhon/.jenkins
java -jar jenkins.war
SET JENKINS_HOME=C:\users\jhon\.jenkins
java -jar jenkins.war
Powershell should be like
[Environment]::SetEnvironmentVariable("JENKINS_HOME", "${PWD}\.jenkins")
java -jar jenkins.war
This will set your home directory to the current-working-directory + './jenkins'