leofrk
Posts: 1
Joined: Wed Apr 03, 2019 2:19 pm

Installing a minecraft server in 1.7.10 (java error)

Wed Apr 03, 2019 2:23 pm

Hello everyone
I'm new with raspbery pi and I hope that I am in the good forum !
So I want to install a minecraft server in 1.7.10
So I have tried many solution but it don't work !

I currently try to follow this tutorial :
https://raspbian-france.fr/installer-se ... ment-74657

But when I use this command : "java -Xmx1024M -jar BuildTools.jar --rev 1.7.10" I have the following error :
Loading BuildTools version: git-BuildTools-6fc608d-96 (#96)
Java Version: Java 8
Exception in thread “main” joptsimple.UnrecognizedOptionException: X is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:633)
at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:528)
at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:523)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
at joptsimple.OptionParser.parse(OptionParser.java:396)
at org.spigotmc.builder.Builder.main(Builder.java:139)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:40)
What should I do ?

Andyroo
Posts: 2864
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Installing a minecraft server in 1.7.10

Wed Apr 03, 2019 7:05 pm

It looks like the Java is not taking the ‘X’ but I’m not a Java programmer so I’ve asked the mods to move this to the Java sub forum.

You may do better if you edit the subject (by modifying your fist post with the pencil) to say ‘Java command line error when starting Minecraft’
Need Pi spray - these things are breeding in my house...

Heater
Posts: 12153
Joined: Tue Jul 17, 2012 3:02 pm

Re: Installing a minecraft server in 1.7.10 (java error)

Thu Apr 04, 2019 7:04 am

What happens if you just type "java -X" ?
I get this on Debian:

Code: Select all

$ java -X
    ....
    -Xmx<size>        set maximum Java heap size
    ....
The -X options are non-standard and subject to change without notice.
$
$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1~deb9u1-b01)
OpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode)
$
Sounds like you JDK does not have X options.

What happens if you remove the "-Xmx1024M" from your command?

B.Goode
Posts: 7719
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Installing a minecraft server in 1.7.10 (java error)

Thu Apr 04, 2019 7:49 am

leofrk wrote:
Wed Apr 03, 2019 2:23 pm

I currently try to follow this tutorial :
https://raspbian-france.fr/installer-se ... ment-74657

But when I use this command : "java -Xmx1024M -jar BuildTools.jar --rev 1.7.10" I have the following error :
[ ... ]

That command that gives you an error does not appear in the tutorial you claim to be following.

User avatar
HawaiianPi
Posts: 3865
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Installing a minecraft server in 1.7.10 (java error)

Sun Jun 02, 2019 6:18 pm

That's an odd error. What version of Java are you using?

Regardless, you can't allocate all 1024MB of RAM to the Java heap. First of all, that leaves no memory for the OS, and secondly, Java uses RAM outside the heap as well. Oh, and let's not forget the GPU needs at least 16MB of RAM. So you are trying to allocate 1024MB on a system that only has 1008MB available (before the OS and Java are loaded).

That's the biggest mistake I see when trying to build or run a Minecraft server on a Pi. I don't know who was responsible for the original error, but everyone seems to copy and repost the same nonsense in guides. The Raspberry Pi 2B, 3B and 3B+ computers only have 1GB (1024MB) of system RAM, and at least 16MB of that needs to be reserved for the GPU (default is actually 64MB).

It's been awhile since I've tried to build Spigot, but I do recall some memory issues when using newer versions of BuildTools.jar.
Give me a sec to look for my old build script and I'll update this post if I find anything...

EDIT:
I just successfully built SpigotMC for version 1.12.2 (used on my Creeper Pie SMP server).

Try building your server with the following:

Code: Select all

java -Xmx640M -jar BuildTools.jar --rev 1.7.10

And don't make the same mistake when you run your server (leave some RAM for the OS and Java outside the heap). I suggest using 800 MB as the max when running the server (-Xmx800M).

This is the script I use to run my headless Creeper Pie server on a 3B+ with Raspbian Stretch Lite.

Code: Select all

#!/bin/bash
# Run a Spigot Minecraft server on screen session "minecraft"
if ! screen -list | grep -q "minecraft"; then
  cd ~/Minecraft
  screen -S minecraft -d -m java -jar  -Xms640M -Xmx800M spigot-1.12.2.jar nogui
fi
screen -r minecraft
exit
I run it in a screen session so I can SSH into the system to control the server and logout without affecting the server. My server has been running since 2017 and has been very stable for myself and a few friends.


B.Goode wrote:
Thu Apr 04, 2019 7:49 am
That command that gives you an error does not appear in the tutorial you claim to be following.
Yes it does. It's in the section about building the server (which, BTW, is SpigotMC).

Although I just noticed another problem with the tutorial. The sudo command is not needed to build or run the server (and should not be used on anything inside the user's home directory). Oh wait, I see what they did. They created a Minecraft folder outside the user's directory. Mine is in my user's folder (~/Minecraft), so I don't need sudo.

Here is the script I wrote to build the latest SpigotMC 1.12.2 server.

Code: Select all

#!/bin/bash
# Build the SpigotMC server for Minecraft Java Edition version 1.12.2
cd ~/Spigot
rm -vfr *
echo Downloading the latest BuildTools.jar
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
echo Building Spigot/Craftbukkit...
git config --global --unset core.autocrlf
java -Xmx640M -jar BuildTools.jar --rev 1.12.2
echo Backing up old Spigot/Craftbukkit...
cd ~/Minecraft
cp -vf spigot-backup.zip /mnt/Backup/spigot-backup.zip
zip -uv spigot-backup.zip spigot-1.12.2.jar craftbukkit-1.12.2.jar
echo moving files to the Minecraft folder...
mv -fv ~/Spigot/craftbukkit-1.12.2.jar ~/Minecraft
mv -fv ~/Spigot/spigot-1.12.2.jar ~/Minecraft
echo Backing up world saves...
cd ~/Minecraft/saves
zip -urv Mushroom.zip Mushroom Mushroom_nether Mushroom_the_end
echo All finihed, re-launch Spigot Minecraft server in 10 seconds.
sleep 10
cd ~
./minecraft.sh
exit
I'm guessing the OP's error is due to either an incompatible Java or an old version of BuildTools.jar.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “Java”