Running shell script with java on linux -
i moving runescape private server windows linux. server has run.bat 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 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 have openjdk 7 installed.
when try run run.sh file terminal shows me following:
usage: java [-options] class [args...] (to execute class) or java [-options] -jar jarfile [args...] (to execute jar file) options include: -d32 use 32-bit data model if available -d64 use 64-bit data model if available -server select "server" vm -zero select "zero" vm -jamvm select "jamvm" vm -avian select "avian" vm -dcevm select "dcevm" vm default vm server. -cp <class search path of directories , zip/jar files> -classpath <class search path of directories , zip/jar files> : separated list of directories, jar archives, , zip archives search class files. -d<name>=<value> set system property -verbose:[class|gc|jni] enable verbose output -version print product version , exit -version:<value> require specified version run -showversion print product version , continue -jre-restrict-search | -no-jre-restrict-search include/exclude user private jres in version search -? -help print message -x print on non-standard options -ea[:<packagename>...|:<classname>] -enableassertions[:<packagename>...|:<classname>] enable assertions specified granularity -da[:<packagename>...|:<classname>] -disableassertions[:<packagename>...|:<classname>] disable assertions 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 , -agentlib:hprof=help -agentpath:<pathname>[=<options>] load native agent library full pathname -javaagent:<jarpath>[=<options>] load java programming language agent, see java.lang.instrument -splash:<imagepath> show splash screen specified image see http://www.oracle.com/technetwork/java/javase/documentation/index.html more details.
i understand probally syntax wrong, regrets not have linux knowledge.
could me find wrong?
you're missing space between classpath argument , name of 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 same 1 on windows except using colons instead of semi-colons path separators, 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 space between classpath , -server
argument in initial command.
Comments
Post a Comment