#I cant start my server because java used a strange install path

11 messages · Page 1 of 1 (latest)

weak nest
#

I have a server I am trying to set up, it is hosted on a VPS running Ubuntu LTS. OpenJDK is installed in an odd directory and only a sym-link exists in the place where the game looks for java. I know the real install path. How do I tell the server to look for java in the correct location?

for context this is the error in the console
couldn't determine 32/64 bit of java

I know I need to add the path to server-start.sh but I don't know how to format it.

queen skiff
#

The game has a pre-packaged Java

#

Whats the whole error that you get?

weak nest
#

I didn't have a chance to update this last night, the startup script was looking in the wrong directory, and had to be rewritten, additionally the executable needed to have its permissions elevated. The server starts now but can't connect to the internet, but that is probably due to an issue in PufferPanel itself.

this is the start-server.sh that the server came with, I still don't know why it doesn't work

#!/bin/bash
#
###############################################################################
#
# Edit memory option -Xmx in ProjectZomboid64.json for 64bit servers (common)
#   or ProjectZomboid32.json for 32bit servers (rare)
#
############

INSTDIR="`dirname $0`" ; cd "${INSTDIR}" ; INSTDIR="`pwd`"

if "${INSTDIR}/jre64/bin/java" -version > /dev/null 2>&1; then
    echo "64-bit java detected"
    export PATH="${INSTDIR}/jre64/bin:$PATH"
    export LD_LIBRARY_PATH="${INSTDIR}/linux64:${INSTDIR}/natives:${INSTDIR}:${INSTDIR}/jre64/lib/amd64:${LD_LIBRARY_PATH}"
    JSIG="libjsig.so"
    LD_PRELOAD="${LD_PRELOAD}:${JSIG}" ./ProjectZomboid64 "$@"
elif "${INSTDIR}/jre/bin/java" -client -version > /dev/null 2>&1; then
    echo "32-bit java detected"
    export PATH="${INSTDIR}/jre/bin:$PATH"
    export LD_LIBRARY_PATH="${INSTDIR}/linux32:${INSTDIR}/natives:${INSTDIR}:${INSTDIR}/jre/lib/i386:${LD_LIBRARY_PATH}"
    JSIG="libjsig.so"
    LD_PRELOAD="${LD_PRELOAD}:${JSIG}" ./ProjectZomboid32 "$@"
else
    echo "couldn't determine 32/64 bit of java"
fi
exit 0

#
# EOF
#
###############################################################################

this is the rewritten start-server.sh that works. it will only work for 64x server.

#!/bin/bash
#
###############################################################################
#
# Edit memory option -Xmx in ProjectZomboid64.json for 64bit servers (common)
#   or ProjectZomboid32.json for 32bit servers (rare)
#
############

INSTDIR="`dirname $0`" ; cd "${INSTDIR}" ; INSTDIR="`pwd`"

echo start
echo $INSTDIR
echo end

    echo "64-bit java detected"
    export PATH="${INSTDIR}/jre64/bin:$PATH"
    export LD_LIBRARY_PATH="${INSTDIR}/linux64:${INSTDIR}/natives:${INSTDIR}:${INSTDIR}/jre64/lib/amd64:${LD_LIBRARY_PATH}"
    JSIG="libjsig.so"
    LD_PRELOAD="${LD_PRELOAD}:${JSIG}" ./ProjectZomboid64 "$@"

exit 0

#
# EOF
#
###############################################################################
#

also of note is that apparently pufferpanel is inside a docker container

#

hopefully this info will help others facing the same oddly specific issues

queen skiff
#

I do not think I can help you with using third party docker containers

#

Or whatever PufferPanel is, as we are not responsible for creating those packages / images

#

So I would recommend forwarding the fix to whoever created that docker image perhaps?

weak nest
sly jackal
#

@weak nest Thanks it worked for me!!

To clarify the "executable needed to have its permissions elevated" part:

sudo chmod 777 ProjectZomboid64

worked for me