【发布时间】:2014-10-03 14:08:35
【问题描述】:
我是使用 Jetty 服务器的新手。要启动Jetty v8.1 使用命令提示符,我需要导航到jetty-distribution-8.1.16.v20140903 文件夹并运行命令:java -jar start.jar。
如果我没有导航到 jetty-distribution-8.1.16.v20140903 文件夹并尝试使用以下命令启动命令:java -jar C:\jetty-distribution-8.1.16.v20140903\start.jar,那么我会得到一个 FileNotFoundException:
java.io.FileNotFoundException: No XML configuration files specified in start.con
fig or command line.
at org.eclipse.jetty.start.Main.start(Main.java:502)
at org.eclipse.jetty.start.Main.main(Main.java:96)
Usage: java -jar start.jar [options] [properties] [configs]
java -jar start.jar --help # for more information
启动服务器时它会查找哪些文件?请让我知道如何在不导航到分发文件夹的情况下启动码头服务器。
编辑:
当我尝试这个命令时:
java -Djetty.home= C:\jetty-distribution-8.1.16.v20140903 -jar C:\jetty-distribution-8.1.16.v20140903/start.jar
我收到以下错误:
Caused by: java.lang.ClassNotFoundException: C:\jetty-distribution-8.1.16.v20140
903
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: C:\jetty-distribution-8.1.16.v20140903. Program
will exit.
请提出建议。
【问题讨论】:
标签: java jetty command-prompt