# Error with .jar file

**URL:** <https://forums.balena.io/t/error-with-jar-file/331364>\
**Category:** Project help\
**Created:** [June 26, 2021, 11:36pm UTC](https://forums.balena.io/t/error-with-jar-file/331364 "2021-06-26T23:36:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 26, 2021, 11:36pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/1 "2021-06-26T23:36:06Z")

</div>

Hi all.

I’m following the minecraft server guide and have has some errors but have reached a point where I haven’t found any more threads. I’ve gotten to [this](https://github.com/AlexProgrammerDE/balena-minecraft-server/issues/109) thread, I’ve deleted the native .jar file and replaced it with the one from the official Minecraft website [here](https://www.minecraft.net/en-us/download/server). I’m now getting this error:

 ![image](https://global.discourse-cdn.com/balena/original/2X/5/582333bea7c950c81bb2c906d0e908ff4c84d9f1.png)

My (quite limited) understanding of this is that I need to update java on my Pi, but I’m not sure how to do that.  
TYIA and any help is appreciated.

---

<div class="post-metadata">

**Author:** ![cywang117](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/cywang117/32/6307_2.png) [@cywang117](https://forums.balena.io/u/cywang117)\
**Post date:** [June 29, 2021, 8:02am UTC](https://forums.balena.io/t/error-with-jar-file/331364/3 "2021-06-29T08:02:25Z")

</div>

Hi @axlotl1,  
Some questions that’ll help us better understand what might be happening: Did you see an error similar to `Error: Invalid or corrupt jarfile paper.jar` which prompted you to replace the native .jar file with the official Minecraft .jar? Which device are you attempting to run an MC server on, and which Minecraft version? I see in this GitHub issue thread ([Error: Invalid or corrupt jarfile paper.jar · Issue #99 · AlexProgrammerDE/balena-minecraft-server · GitHub](https://github.com/AlexProgrammerDE/balena-minecraft-server/issues/99)) that it was suggested to add an environment variable ENABLE\_UPDATES and set it to true. Has that been done on your balenaCloud dashboard?  
Regards,  
Christina

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 29, 2021, 7:57pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/5 "2021-06-29T19:57:23Z")

</div>

Hi!

Yes I was getting the “Error: Unable to access jar file paper.jar” which I’m now getting again. I thought I had set ENABLE\_UPDATES to true but I will do it through the dashboard to see if it fixes it.

I’ve got a raspberry pi 4B and the jar file I used is 1.17 version.

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 29, 2021, 8:37pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/6 "2021-06-29T20:37:24Z")

</div>

I’ve added the environment variable but I’m still getting the same error unfortunately

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [June 29, 2021, 11:49pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/7 "2021-06-29T23:49:35Z")

</div>

Hi Greg, I have two quick thoughts on this issue.

First, while I can definitely understand the desire to build the project yourself and all the learning that goes along with it, I am wondering what happens if you try to deploy one of the ready-made builds by simply clicking the blue “Get Started” button here: [balenaHub: an easier way to find and publish apps and projects for edge devices](https://hub.balena.io/gh_alexprogrammerde/balena-minecraft-server)

Second, even doing a full build of your own should have worked, and there should not have been a need to swap out any .jar files. Are you able to try building from scratch, and let us know what the error you receive is? I suspect @AlexProgrammerDE will want to know what went wrong on the build. Thanks!

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 30, 2021, 12:41am UTC](https://forums.balena.io/t/error-with-jar-file/331364/9 "2021-06-30T00:41:57Z")

</div>

Hi,

I had no idea that fleets were ready-made, I’m glad you’ve shown me them as it will make my life easier. All I have to do is flash it to the microSD I’m using and it’ll work? Will it show up on my dashboard or is it a standalone piece?

When you say building from scratch, do you mean following the guide from beginning to end? I can retry the whole process if needed.

Thanks

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [June 30, 2021, 1:35am UTC](https://forums.balena.io/t/error-with-jar-file/331364/10 "2021-06-30T01:35:49Z")

</div>

Yes, that is correct, simply flash it and the project will build and deploy to the device. It will take about an hour probably start to finish, from containers building, to device downloading them and running. You do lose the visibility of the dashboard in this scenario, however, and it’s just a standalone device. In fact, you’ll have to check your network for the IP address that gets assigned to the Pi. That IP address is what you would then use as the MC Server IP to connect to.

Or, alternatively like you mentioned, you can rebuild the project from scratch and we can try to troubleshoot what went wrong.

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 30, 2021, 2:13am UTC](https://forums.balena.io/t/error-with-jar-file/331364/12 "2021-06-30T02:13:14Z")

</div>

I’m guessing connecting the server worldwide is the same process as building the project, so I’ll use the fleet for now and worst case scenario I’ll rebuild from scratch and troubleshoot with you kind folks!

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![vipulgupta2048](https://avatars.discourse-cdn.com/v4/letter/v/a183cd/32.png) [@vipulgupta2048](https://forums.balena.io/u/vipulgupta2048)\
**Post date:** [June 30, 2021, 12:00pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/13 "2021-06-30T12:00:30Z")

</div>

Happy to help, let us know if you have troubles with the paths that David recommended. Especially with your device joining the fleet on Hub, we are looking forward to feedback on that. Any logs or errors that you see would be most helpful in debugging if you end up trying to rebuild the project from scratch.

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 30, 2021, 7:50pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/15 "2021-06-30T19:50:31Z")

</div>

Hi folks!

I’ve flashed the fleet on a microSD, put it in my Pi and plugged it into power and ethernet, and left if for a few hours. I’m not getting this error from Minecraft when trying to connect. Did I pull the wrong IP?

 ![image](https://global.discourse-cdn.com/balena/original/2X/8/86993e59fa7457fa023c8b5dfd3387426774032e.png)

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [June 30, 2021, 8:00pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/16 "2021-06-30T20:00:43Z")

</div>

Well, that is possible. There are a few options:

- What does that button do, that says “Back to Server List”? Does it happen to show any other local servers? 🙂
- Second, if you login to your router, can you check for any / all devices and their IP addresses that are on your network? A balena device will probably show up by name as a random string of letters/numbers, so that might help narrow down which one it is. The in Minecraft, try connecting to that IP address.
- Finally, @AlexProgrammerDE (who manages the fleet) might be able to double check the device to find its local IP, and ensure it is online / healthy.

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [June 30, 2021, 8:11pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/18 "2021-06-30T20:11:20Z")

</div>

Back to server list shows me a list of global servers I have saved, and the searching for local sever message but it hasn’t found one. I’ve tried all IPs that fit the random string of numbers/letters name and none of them worked, although one gave me a timeout instead of connection refused.

@AlexProgrammerDE Whenever you’ve got a moment could you check for my device?

---

<div class="post-metadata">

**Author:** ![axlotl1](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@axlotl1](https://forums.balena.io/u/axlotl1)\
**Post date:** [July 2, 2021, 2:36am UTC](https://forums.balena.io/t/error-with-jar-file/331364/19 "2021-07-02T02:36:39Z")

</div>

I tried a few different things today;

1. First, I made sure I knew the IP of my Pi, its now showing up on my router like this:  
 ![image](https://global.discourse-cdn.com/balena/original/2X/3/34cd4249cd0500e69ce8e4744a1af732870a7b43.png)
2. Next, I reinstalled java on my PC that I was using to connect to the server, same error.
3. I also turned off my firewall to see if that was the issue and got the same error.

I think I’ll attempt a fresh build and see how it goes, as that seems to be the best way to see what’s going on on the Pi.

---

<div class="post-metadata">

**Author:** ![cywang117](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/cywang117/32/6307_2.png) [@cywang117](https://forums.balena.io/u/cywang117)\
**Post date:** [July 8, 2021, 6:47am UTC](https://forums.balena.io/t/error-with-jar-file/331364/21 "2021-07-08T06:47:28Z")

</div>

Hi @axlotl1, checking in to see if a fresh build worked for you. I deployed a balena Minecraft server to test the steps and see if I could replicate, and was able to connect without issues. Here are the steps I took:

- Click the “Deploy with balena” button here: [GitHub - AlexProgrammerDE/balena-minecraft-server: Build a Minecraft Server using a Raspberry Pi 4! Supports common Servers, SCP, RCON and Wifi Connect.](https://github.com/AlexProgrammerDE/balena-minecraft-server#one-click-deployment)
- Wait for application to be created, click “add device”, download image and flash onto a RPi 4
- Launch Minecraft client and click “direct connect”. Enter the Local IP address that’s listed on your dashboard’s device summary page.

With a fresh build and following these steps, does Minecraft start up fine for you?

Regards,  
Christina

---

<div class="post-metadata">

**Author:** ![AlexProgrammerDE](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexprogrammerde/32/3040_2.png) [@AlexProgrammerDE](https://forums.balena.io/u/AlexProgrammerDE)\
**Post date:** [July 14, 2021, 12:28pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/23 "2021-07-14T12:28:45Z")

</div>

@axlotl1 Hi! Sorry for the extremely late response, but I wanted to let you know this issue has been resolved. If you use the open fleet then your device should have automatically been updated. If not then you need to redeploy the recent balena minecraft server repository to the raspberry pi as @cywang117 explained in the post above. The issue was that minecraft now requires java 16 to run properly and the older balena minecraft server versions only had Java 11, which made them not compatible. Hope it helps. Cheers!

---

<div class="post-metadata">

**Author:** ![pwgjrmc](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@pwgjrmc](https://forums.balena.io/u/pwgjrmc)\
**Post date:** [August 24, 2021, 5:55pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/25 "2021-08-24T17:55:53Z")

</div>

Hi @cywang117, I just followed your steps as outlined. When I try to join server I get a connection refused error. In my dashboard logs I am getting the following:  
Starting balenaMinecraftServer…  
mc-server  
mc-server Forcing server update  
mc-server Downloading 1.17.1 build 209…  
mc-server Starting JAR file with: 2G of RAM  
mc-server Error: Unable to access jarfile paper.jar

I don’t know where to go from here…  
I have an RPi 4 w/ 4g ram  
Everything was working( my son and I playing MC together) until about a week ago when it stopped…don’t know why…have tested the board with a RPi OS to verify the board is working, it is…  
TIA for your help

---

<div class="post-metadata">

**Author:** ![pwgjrmc](https://avatars.discourse-cdn.com/v4/letter/p/8797f3/32.png) [@pwgjrmc](https://forums.balena.io/u/pwgjrmc)\
**Post date:** [August 25, 2021, 9:41pm UTC](https://forums.balena.io/t/error-with-jar-file/331364/26 "2021-08-25T21:41:49Z")

</div>

For this error, it was resolved by deleting the jar file and rebooting. upon reconnecting java was updated to 16 and all is well.
