2

I am moving my Runescape private server from Windows to Linux. The server has a run.bat to start up.

@echo off
title Project Kingscape
java -cp bin;deps/poi.jar;deps/mysql.jar;deps/mina.jar;deps/slf4j.jar;deps/slf4j-nop.jar;deps/jython.jar;log4j-1.2.15.jar;-server -XX:+AggressiveHeap -XX:MaxHeapFreeRatio=90 -XX:MinHeapFreeRatio=90 -XX:+DisableExplicitGC -XX:+RelaxAccessControlCheck -XX:+UseParallelGC -XX:CompileThreshold=1 -XX:ThreadStackSize=128 server.Server
pause

I converted this to the following .sh script:

#!/bin/bash
java -classpath bin:deps/poi.jar:deps/mysql.jar:deps/mina.jar:deps/slf4j.jar:deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar:server.Server
read

I also have OpenJdk 7 installed.

When I try to run the run.sh file the terminal shows me the following:

Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available
    -d64          use a 64-bit data model if available
    -server       to select the "server" VM
    -zero         to select the "zero" VM
    -jamvm        to select the "jamvm" VM
    -avian        to select the "avian" VM
    -dcevm        to select the "dcevm" VM
                  The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
                  A : separated list of directories, JAR archives,
                  and ZIP archives to search for class files.
    -D<name>=<value>
                  set a system property
    -verbose:[class|gc|jni]
                  enable verbose output
    -version      print product version and exit
    -version:<value>
                  require the specified version to run
    -showversion  print product version and continue
    -jre-restrict-search | -no-jre-restrict-search
                  include/exclude user private JREs in the version search
    -? -help      print this help message
    -X            print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
                  enable assertions with specified granularity
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
                  disable assertions with specified granularity
    -esa | -enablesystemassertions
                  enable system assertions
    -dsa | -disablesystemassertions
                  disable system assertions
    -agentlib:<libname>[=<options>]
                  load native agent library <libname>, e.g. -agentlib:hprof
                  see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
                  load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
                  load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
                  show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

I understand that probally my syntax is wrong, but to my regrets i do not have any linux knowledge.

Could someone help me to find you what is wrong?

1
  • 3
    Is it a typo that there is no space before server.Server? Commented Apr 26, 2015 at 10:46

1 Answer 1

3

You're missing a space between the classpath argument and the name of the main class:

java -classpath bin:deps/poi.jar:deps/mysql.jar:deps/mina.jar:deps/slf4j.jar: \
deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar server.Server
                                                  ~ ~

The command should be exactly the same as the one on Windows except for using colons instead of semi-colons as path separators, so ideally:

java -cp bin:deps/poi.jar:deps/mysql.jar:deps/mina.jar:deps/slf4j.jar: \
deps/slf4j-nop.jar:deps/jython.jar:log4j-1.2.15.jar \
-server -XX:+AggressiveHeap -XX:MaxHeapFreeRatio=90 -XX:MinHeapFreeRatio=90 \
-XX:+DisableExplicitGC -XX:+RelaxAccessControlCheck -XX:+UseParallelGC \
-XX:CompileThreshold=1 -XX:ThreadStackSize=128 server.Server

Notice there should also be a space between the classpath and the -server argument in the initial command.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank, thank you alot. 2 days of searching and you just fixed it. I can accept your answer in 6 minutes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.