Wednesday, February 16, 2022

[SOLVED] vServer Linux - Start jar: Invalid or corrupt jarfile

Issue

I'm running a Linux vServer with Debian 8.0 64 bit with 512 MB RAM and 150GB space.

Its planned to use it for a game and let a Server.jar run nonstop. The Server is working with Kryonet, a library for simple Client/Server communication. On my server i installed Java 1.8 and its working fine, for testing i downloaded Minecraft server jar, it works perfectly. So i packed my Server into a executable jar with eclipse (compile version 1.8), it worked fine when starting it with cmd on my computer (Java 8 installed) but when trying to start it on the server: Error: Invalid or corrupt jarfile Server.jar

I thought it could be a problem with the librarys i used, so i tried a clean HelloWorld jar, also does not work.

Here is a screenshot showing my installed java version and trying to run my HelloWorld jar. enter image description here


Solution

I solved the problem!

The jar really was corrupted: I transfered the jar on my server by using mediafire as hoster and using the direct download link to download the jar on to the server via wget <url>.

Seemingly mediafire was damaging the jars (maybe by compressing them), so i used Dropbox as hoster and everything worked fine!

I hope i can help someone having the same problem.



Answered By - user3742480
Answer Checked By - Pedro (WPSolving Volunteer)