# Unable to access jarfile remoting.jar

**URL:** <https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131>\
**Category:** Using Jenkins\
**Tags:** question\
**Created:** [December 29, 2021, 1:36am UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131 "2021-12-29T01:36:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiwiteamllc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kiwiteamllc/32/752_2.png) [@kiwiteamllc](https://community.jenkins.io/u/kiwiteamllc)\
**Post date:** [December 29, 2021, 1:36am UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/1 "2021-12-29T01:36:15Z")

</div>

I am have a Jenkins setup, where Controller (linux) is connected to slave (windows) via ssh using username/password authentication. I am whenever I try to launch the agent I get `Error: Unable to access jarfile remoting.jar`. I have tried modifying the file and folder permissions, but that didn’t seen to fix the issue. What is causing jenkins to not be able to access or execute the jarfile?

“Remote Root Directory” is set to `D:\Jenkins1114`, Default Shell is `cmd.exe`, Java version on slave is `16.0.1`, Java version on Controller is `11.0.13`

Relevant logs:

```auto
[12/28/21 15:37:40] [SSH] Starting agent process: cd "D:\Jenkins1114" && java -jar remoting.jar -workDir D:\Jenkins1114 -jar-cache D:\Jenkins1114/remoting/jarCache
Error: Unable to access jarfile remoting.jar
Agent JVM has terminated. Exit code=1
[12/28/21 15:37:41] Launch failed - cleaning up connection
[12/28/21 15:37:41] [SSH] Connection closed.

```

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [December 29, 2021, 1:38am UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/2 "2021-12-29T01:38:58Z")

</div>

s/slave/agent/

I don’t think java 16 us supported yet, but I don’t think that would cause the problem

My guess is that the jar file isn’t a jar file. Can you open it in an editor to confirm its not html, or rename it to .zip and see if explorer can read the contents?

---

<div class="post-metadata">

**Author:** ![kiwiteamllc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kiwiteamllc/32/752_2.png) [@kiwiteamllc](https://community.jenkins.io/u/kiwiteamllc)\
**Post date:** [December 29, 2021, 3:08pm UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/3 "2021-12-29T15:08:22Z")

</div>

Sorry for the _very_ late reply. The file can be read by explorer when renamed to .zip. I will try downgrading to java 11 later today, and will update this thread if it works.

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [December 29, 2021, 6:08pm UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/4 "2021-12-29T18:08:18Z")

</div>

> [@kiwiteamllc](#):
>
> `Error: Unable to access jarfile remoting.jar`

In all the results of googling, [4 Useful Methods to Fix the “Unable to Access Jarfile” Error - MiniTool](https://www.minitool.com/news/unable-to-access-jarfile.html) might be the only useful one (I found it amusing that I found your StackOverflow issue too).

So its possible that your %JAVA\_HOME% isn’t set right. or The filesystem its trying to run on isn’t happy with java (network mount? tmp? some windows security? etc).

Otherwise I don’t really know sorry.

---

<div class="post-metadata">

**Author:** ![kiwiteamllc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kiwiteamllc/32/752_2.png) [@kiwiteamllc](https://community.jenkins.io/u/kiwiteamllc)\
**Post date:** [December 30, 2021, 9:52pm UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/5 "2021-12-30T21:52:53Z")

</div>

Thank you for your help!

UPDATE: I have figured out that it must have something to do with the cmd.exe shell, because it runs fine on PowerShell. I will try to figure out a workaround for this and will update this thread later today.

---

<div class="post-metadata">

**Author:** ![kuisathaverat](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kuisathaverat/32/101_2.png) [@kuisathaverat](https://community.jenkins.io/u/kuisathaverat)\
**Post date:** [January 4, 2022, 12:15pm UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/6 "2022-01-04T12:15:02Z")

</div>

The error is in the troubleshooting guide [ssh-slaves-plugin/TROUBLESHOOTING.md at 22bdd5d2b9f429b099400390330bd1801e5467c5 · jenkinsci/ssh-slaves-plugin · GitHub](https://github.com/jenkinsci/ssh-slaves-plugin/blob/22bdd5d2b9f429b099400390330bd1801e5467c5/doc/TROUBLESHOOTING.md#use-remote-root-directory-in-a-no-c-drive)

---

<div class="post-metadata">

**Author:** ![teilo](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@teilo](https://community.jenkins.io/u/teilo)\
**Post date:** [January 5, 2022, 8:36pm UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/7 "2022-01-05T20:36:58Z")

</div>

Cd on windows in CMD.exe changes the path for the drive but do es not change the drive.

So `cd d:\foo` still leaves you in C:\somewhere. To change the current drive you also need to `cd d:`. (note the absence of a path.

So by using -jar renoting.jar you are telling java to load tempting fro. The current drive and path which will likely be somewhere in C:\

Either add a call tomorrow cd to change the drive or pass the full path to remoting.jar to java.

---

<div class="post-metadata">

**Author:** ![kiwiteamllc](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kiwiteamllc/32/752_2.png) [@kiwiteamllc](https://community.jenkins.io/u/kiwiteamllc)\
**Post date:** [January 8, 2022, 1:15am UTC](https://community.jenkins.io/t/unable-to-access-jarfile-remoting-jar/1131/8 "2022-01-08T01:15:24Z")

</div>

Thank you so much, this worked!
