linux - 运行 run.sh 时出错(linux)

标签 linux error-handling sh vps

我最近在运行 run.sh 时遇到了此错误。我正在尝试在我的 Linux VPS 上运行 Runescape 私有(private)服务器;这是一个很大的错误。请帮助我,我不知道还需要添加哪些其他详细信息。

错误:

jacob@ace:~/Server/source$ sh run.sh
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
              The default VM is server,
              because you are running on a server-class machine.


-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.
run.sh: 1: run.sh: deps/poi.jar: Permission denied
run.sh: 1: run.sh: deps/mysql.jar: Permission denied
run.sh: 1: run.sh: deps/mina.jar: Permission denied

运行.sh:

java -Xmx800m -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.Server
read

最佳答案

#!/bin/sh -vx 添加为 run.sh 脚本的第一行(以获取 shell 的跟踪信息)。

您可能需要引用类路径,即

   java -Xmx800m -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.Server
   read

我强烈建议花几个小时阅读 advanced bash scripting guide .

关于linux - 运行 run.sh 时出错(linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16409381/

相关文章:

linux - x86 程序集从文件读取字节到堆栈但 gdb 找不到字节

c++ - 我怎样才能在 C 中获得 Linux 中的绝对鼠标位置

php - 如何以编程方式从 Linux 中的 Apache 重新启动系统服务(不是 Apache)?

error-handling - 如何在不使用 LISP 中的 remove 函数的情况下从列表中删除元素

web-applications - 进入生产环境后处理 Web 应用程序中的错误的方法

java - 如何使用 dbus-java 注册 dbus 对象?

debugging - VB6 中的运行时错误堆栈跟踪或位置

linux - linux shell 管道是流水线吗?

python - 当python脚本失败时,如何停止执行bash脚本?

c++ - 如何关闭先前打开的 shell (C++)